diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-23 22:36:11 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-12-04 09:20:28 +0100 |
commit | c76505e0dee0890e39636ddebd2707ab3ea5b8de (patch) | |
tree | ab45c7dbea66a685bb41bb151f0e19c72bb9315b | |
parent | 30c08e226156e5a36a835c008c67114f22c8da8f (diff) | |
download | ffmpeg-c76505e0dee0890e39636ddebd2707ab3ea5b8de.tar.gz |
vp6: Reset the internal state when aborting key frames header parsing
It prevents leaving the state only half initialized.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit a72cad0a6c05aa74940101e937cb3dc602d7d67b)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-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 3da2e2cbfa..48d7e7bf5b 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); |