[FFmpeg-cvslog] r20676 - trunk/libavcodec/mpeg12.c

michael subversion
Tue Dec 1 00:08:25 CET 2009


Author: michael
Date: Tue Dec  1 00:08:25 2009
New Revision: 20676

Log:
Move "slice below image" check from mpeg_decode_slice to its caller.
Should fix issue1277.

Modified:
   trunk/libavcodec/mpeg12.c

Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c	Mon Nov 30 23:08:22 2009	(r20675)
+++ trunk/libavcodec/mpeg12.c	Tue Dec  1 00:08:25 2009	(r20676)
@@ -1673,10 +1673,7 @@ static int mpeg_decode_slice(Mpeg1Contex
     s->resync_mb_x=
     s->resync_mb_y= -1;
 
-    if (mb_y >= s->mb_height){
-        av_log(s->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s->mb_height);
-        return -1;
-    }
+    assert(mb_y < s->mb_height);
 
     init_get_bits(&s->gb, *buf, buf_size*8);
 
@@ -2390,6 +2387,11 @@ static int decode_chunks(AVCodecContext 
                 if(s2->picture_structure == PICT_BOTTOM_FIELD)
                     mb_y++;
 
+                if (mb_y >= s2->mb_height){
+                    av_log(s2->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s2->mb_height);
+                    return -1;
+                }
+
                 if(s2->last_picture_ptr==NULL){
                 /* Skip B-frames if we do not have reference frames and gop is not closed */
                     if(s2->pict_type==FF_B_TYPE){



More information about the ffmpeg-cvslog mailing list