From: Michael Niedermayer Date: Sat, 3 Mar 2007 21:33:33 +0000 (+0000) Subject: check for no frame and prevent segfault X-Git-Tag: v0.5~9837 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56c70e1d3a1cde2f7490780a4924e6b6e87e4c47;p=platform%2Fupstream%2Flibav.git check for no frame and prevent segfault Originally committed as revision 8211 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 9c568c0..10beead 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -8355,6 +8355,11 @@ static int decode_frame(AVCodecContext *avctx, if(buf_index < 0) return -1; + if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){ + av_log(avctx, AV_LOG_ERROR, "no frame!\n"); + return -1; + } + if(!(s->flags2 & CODEC_FLAG2_CHUNKS) || (s->mb_y >= s->mb_height && s->mb_height)){ Picture *out = s->current_picture_ptr; Picture *cur = s->current_picture_ptr;