diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-02-09 09:38:03 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-02-09 09:38:03 +0000 |
commit | ee7388c934a89aecce919d17bc28773822e2b444 (patch) | |
tree | ca9099f61532ed23c7161c61b92e0a9be7f9b9b6 | |
parent | 4e295993ba58ee1a65c11bebfd9bb61235ebc966 (diff) | |
download | ffmpeg-ee7388c934a89aecce919d17bc28773822e2b444.tar.gz |
fix segfault on broken streams
Originally committed as revision 4966 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ffv1.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 10ba21b4c7..0f9b3446b8 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -959,11 +959,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8 p->pict_type= FF_I_TYPE; //FIXME I vs. P if(get_rac(c, &keystate)){ p->key_frame= 1; - read_header(f); + if(read_header(f) < 0) + return -1; clear_state(f); }else{ p->key_frame= 0; } + if(!f->plane[0].state && !f->plane[0].vlc_state) + return -1; p->reference= 0; if(avctx->get_buffer(avctx, p) < 0){ |