[FFmpeg-cvslog] r24197 - trunk/libavcodec/truespeech.c

kostya subversion
Sun Jul 11 16:50:20 CEST 2010


Author: kostya
Date: Sun Jul 11 16:50:20 2010
New Revision: 24197

Log:
Do not try to decode less than one frame of data in TrueSpeech decoder.
This should solve issue 2085.

Modified:
   trunk/libavcodec/truespeech.c

Modified: trunk/libavcodec/truespeech.c
==============================================================================
--- trunk/libavcodec/truespeech.c	Sun Jul 11 16:44:43 2010	(r24196)
+++ trunk/libavcodec/truespeech.c	Sun Jul 11 16:50:20 2010	(r24197)
@@ -347,6 +347,11 @@ static int truespeech_decode_frame(AVCod
     if (!buf_size)
         return 0;
 
+    if (buf_size < 32) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Too small input buffer (%d bytes), need at least 32 bytes\n", buf_size);
+        return -1;
+    }
     iterations = FFMIN(buf_size / 32, *data_size / 480);
     for(j = 0; j < iterations; j++) {
         truespeech_read_frame(c, buf + consumed);



More information about the ffmpeg-cvslog mailing list