[Ffmpeg-cvslog] r7229 - trunk/libavcodec/h264.c

gpoirier subversion
Tue Dec 5 23:18:20 CET 2006


Author: gpoirier
Date: Tue Dec  5 23:18:19 2006
New Revision: 7229

Modified:
   trunk/libavcodec/h264.c

Log:
fix crash when decoding a truncated H264 slice
patch by Alexander Chemeris % ipse P ffmpeg A gmail.com %
Original thread:
date: Dec 5, 2006 7:26 PM	 
subject: [Ffmpeg-devel] [PATCH] Fix crush when truncated slice passed to H.264 decoder


Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Tue Dec  5 23:18:19 2006
@@ -4883,6 +4883,10 @@
 
     if(total_coeff==0)
         return 0;
+    if(total_coeff<0) {
+        av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff<0)\n", s->mb_x, s->mb_y);
+        return -1;
+    }
 
     trailing_ones= coeff_token&3;
     tprintf("trailing:%d, total:%d\n", trailing_ones, total_coeff);




More information about the ffmpeg-cvslog mailing list