fix a crash on seeking to an invalid frame
authorLoren Merritt <lorenm@u.washington.edu>
Thu, 10 Nov 2005 04:40:49 +0000 (04:40 +0000)
committerLoren Merritt <lorenm@u.washington.edu>
Thu, 10 Nov 2005 04:40:49 +0000 (04:40 +0000)
Originally committed as revision 4685 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264.c

index ea6a479..2bc572b 100644 (file)
@@ -7731,10 +7731,13 @@ static int decode_frame(AVCodecContext *avctx,
         h->delayed_output_pic = out;
 #endif
 
-        *pict= *(AVFrame*)out;
+        if(out)
+            *pict= *(AVFrame*)out;
+        else
+            av_log(avctx, AV_LOG_DEBUG, "no picture\n");
     }
 
-    assert(pict->data[0]);
+    assert(pict->data[0] || !*data_size);
     ff_print_debug_info(s, pict);
 //printf("out %d\n", (int)pict->data[0]);
 #if 0 //?