[FFmpeg-cvslog] r10497 - trunk/libavcodec/ac3dec.c

jbr subversion
Sat Sep 15 04:44:28 CEST 2007


Author: jbr
Date: Sat Sep 15 04:44:28 2007
New Revision: 10497

Log:
skip incomplete frames

Modified:
   trunk/libavcodec/ac3dec.c

Modified: trunk/libavcodec/ac3dec.c
==============================================================================
--- trunk/libavcodec/ac3dec.c	(original)
+++ trunk/libavcodec/ac3dec.c	Sat Sep 15 04:44:28 2007
@@ -1120,6 +1120,12 @@ static int ac3_decode_frame(AVCodecConte
     avctx->sample_rate = ctx->sampling_rate;
     avctx->bit_rate = ctx->bit_rate;
 
+    /* check that reported frame size fits in input buffer */
+    if(ctx->frame_size > buf_size) {
+        av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
+        return -1;
+    }
+
     /* channel config */
     ctx->out_channels = ctx->nchans;
     if (avctx->channels == 0) {




More information about the ffmpeg-cvslog mailing list