diff options
author | Laurent Aimar <fenrir@elivagar.org> | 2011-09-24 16:19:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-01 20:22:52 +0200 |
commit | 35f8ad420a0b7ebcade81c2be3ca5968a5861ddc (patch) | |
tree | 6519627adeeb5bd94f9fd0d828f78ce02e3175a0 | |
parent | f71c761a9e2e528b739e6c86f624ac66357d2327 (diff) | |
download | ffmpeg-35f8ad420a0b7ebcade81c2be3ca5968a5861ddc.tar.gz |
vp6:Reset the internal state when aborting key frames header parsing in vp6 decoder.
It prevents leaving the state only half initialized.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 91f104496bb7632ed5ff03798e06dd8af014f0d9)
-rw-r--r-- | libavcodec/vp6.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index d05a3618f7..3721d52192 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -137,8 +137,11 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, if (coeff_offset) { buf += coeff_offset; buf_size -= coeff_offset; - if (buf_size < 0) + if (buf_size < 0) { + if (s->framep[VP56_FRAME_CURRENT]->key_frame) + avcodec_set_dimensions(s->avctx, 0, 0); return 0; + } if (s->use_huffman) { s->parse_coeff = vp6_parse_coeff_huffman; init_get_bits(&s->gb, buf, buf_size<<3); |