# HG changeset patch # User reimar # Date 1198236844 0 # Node ID 7cde1324cf148be4bb27b8c3eaba9705df560a5c # Parent 25fc785eab224e7514c3a6ebcd8c000f6df666c6 100l, buffer bound checks work better when done _before_ access. diff -r 25fc785eab22 -r 7cde1324cf14 stream/asf_streaming.c --- a/stream/asf_streaming.c Fri Dec 21 11:30:55 2007 +0000 +++ b/stream/asf_streaming.c Fri Dec 21 11:34:04 2007 +0000 @@ -310,21 +310,20 @@ char *end = &buffer[size]; mp_msg(MSGT_NETWORK, MSGL_V, "Stream bitrate properties object\n"); + if (ptr + 2 > end) goto len_err_out; stream_count = AV_RL16(ptr); ptr += 2; - if (ptr > end) goto len_err_out; mp_msg(MSGT_NETWORK, MSGL_V, " stream count=[0x%x][%u]\n", stream_count, stream_count ); for( i=0 ; i end) goto len_err_out; id = AV_RL16(ptr); ptr += 2; - if (ptr > end) goto len_err_out; rate = AV_RL32(ptr); ptr += 4; - if (ptr > end) goto len_err_out; mp_msg(MSGT_NETWORK, MSGL_V, " stream id=[0x%x][%u]\n", id, id); mp_msg(MSGT_NETWORK, MSGL_V,