fix segfault with http://sam.zoy.org/zzuf/lol-ffplay.mpg and http://sam.zoy.org/zzuf...
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Jan 2007 23:26:09 +0000 (23:26 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Jan 2007 23:26:09 +0000 (23:26 +0000)
Originally committed as revision 7538 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpeg12.c

index 36d7153..27d689f 100644 (file)
@@ -3178,6 +3178,10 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
                             if(mpeg_field_start(s2) < 0)
                         return -1;
                     }
+                if(!s2->current_picture_ptr){
+                    av_log(avctx, AV_LOG_ERROR, "current_picture not initalized\n");
+                    return -1;
+                }
 
                 if(avctx->thread_count > 1){
                     int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count;