1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avcodec/vp6: return value check for init_get_bits

As the second argument for init_get_bits(buf) can be crafted,
a return value check for this function call is necessary.
Also replace init_get_bits with init_get_bits8.

Signed-off-by: Peter Ross <pross@xvid.org>
This commit is contained in:
maryam ebrahimzadeh 2021-08-23 14:35:01 -04:00 committed by Peter Ross
parent afeefb306e
commit ad88cce3f8

View File

@ -167,7 +167,9 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
}
if (s->use_huffman) {
s->parse_coeff = vp6_parse_coeff_huffman;
init_get_bits(&s->gb, buf, buf_size<<3);
ret = init_get_bits8(&s->gb, buf, buf_size);
if (ret < 0)
return ret;
} else {
ret = ff_vp56_init_range_decoder(&s->cc, buf, buf_size);
if (ret < 0)