From 5947ca8334f207eb43ef115acb895ecda9b28b2b Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 21 Dec 2007 11:34:04 +0000 Subject: 100l, buffer bound checks work better when done _before_ access. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25481 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/asf_streaming.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'stream') diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c index df5ad2d27a..21e68ccfec 100644 --- a/stream/asf_streaming.c +++ b/stream/asf_streaming.c @@ -310,21 +310,20 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) 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, -- cgit v1.2.3