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 a72cad0a6c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit c76505e0de)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit e28bb18fdc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
Laurent Aimar
2011-09-23 22:36:11 +02:00
committed by Reinhard Tartler
parent 771ceb19f2
commit 9767ea7aa7

View File

@@ -136,8 +136,11 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
if (coeff_offset) { if (coeff_offset) {
buf += coeff_offset; buf += coeff_offset;
buf_size -= 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; return 0;
}
if (s->use_huffman) { if (s->use_huffman) {
s->parse_coeff = vp6_parse_coeff_huffman; s->parse_coeff = vp6_parse_coeff_huffman;
init_get_bits(&s->gb, buf, buf_size<<3); init_get_bits(&s->gb, buf, buf_size<<3);