[FFmpeg-cvslog] r18862 - trunk/libavcodec/tmv.c

vitor subversion
Sun May 17 11:48:13 CEST 2009


Author: vitor
Date: Sun May 17 11:48:12 2009
New Revision: 18862

Log:
Make TMV decoder check packet sizes before reading from it.

FATE test 295 might need updating.

Modified:
   trunk/libavcodec/tmv.c

Modified: trunk/libavcodec/tmv.c
==============================================================================
--- trunk/libavcodec/tmv.c	Sun May 17 11:09:07 2009	(r18861)
+++ trunk/libavcodec/tmv.c	Sun May 17 11:48:12 2009	(r18862)
@@ -52,6 +52,13 @@ static int tmv_decode_frame(AVCodecConte
         return -1;
     }
 
+    if (avpkt->size < 2*char_rows*char_cols) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Input buffer too small, truncated sample?\n");
+        *data_size = 0;
+        return -1;
+    }
+
     tmv->pic.pict_type = FF_I_TYPE;
     tmv->pic.key_frame = 1;
     dst                = tmv->pic.data[0];



More information about the ffmpeg-cvslog mailing list