From 3165e258b14e3af13d368d00993cdc6d28a566c9 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Thu, 10 Nov 2005 04:40:49 +0000 Subject: [PATCH] fix a crash on seeking to an invalid frame Originally committed as revision 4685 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index ea6a479bed..2bc572b906 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -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 //?