1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

check for no frame and prevent segfault

Originally committed as revision 8211 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2007-03-03 21:33:33 +00:00
parent 6cb8b1c364
commit 56c70e1d3a

View File

@ -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;