[FFmpeg-cvslog] r18707 - trunk/libavcodec/adpcm.c

vitor subversion
Mon Apr 27 18:06:01 CEST 2009


Author: vitor
Date: Mon Apr 27 18:06:01 2009
New Revision: 18707

Log:
Check if there is enough bytes before reading the buffer in the EA ADPCM 
decoder. Fix issue 990.

Modified:
   trunk/libavcodec/adpcm.c

Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c	Mon Apr 27 18:04:43 2009	(r18706)
+++ trunk/libavcodec/adpcm.c	Mon Apr 27 18:06:01 2009	(r18707)
@@ -1209,11 +1209,11 @@ static int adpcm_decode_frame(AVCodecCon
         }
         break;
     case CODEC_ID_ADPCM_EA:
-        samples_in_chunk = AV_RL32(src);
-        if (samples_in_chunk >= ((buf_size - 12) * 2)) {
+        if (buf_size < 4 || AV_RL32(src) >= ((buf_size - 12) * 2)) {
             src += buf_size;
             break;
         }
+        samples_in_chunk = AV_RL32(src);
         src += 4;
         current_left_sample   = (int16_t)bytestream_get_le16(&src);
         previous_left_sample  = (int16_t)bytestream_get_le16(&src);



More information about the ffmpeg-cvslog mailing list