diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-03-03 21:33:33 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-03-03 21:33:33 +0000 |
commit | 56c70e1d3a1cde2f7490780a4924e6b6e87e4c47 (patch) | |
tree | 764419ac9afd609732fb46fe200eebe8264feab9 /libavcodec/h264.c | |
parent | 6cb8b1c3646533e684312a4c65a05413d3cafa86 (diff) | |
download | ffmpeg-56c70e1d3a1cde2f7490780a4924e6b6e87e4c47.tar.gz |
check for no frame and prevent segfault
Originally committed as revision 8211 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 9c568c0033..10beead96a 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; |