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>
pull/365/head
maryam ebrahimzadeh 3 years ago committed by Peter Ross
parent afeefb306e
commit ad88cce3f8
  1. 4
      libavcodec/vp6.c

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

Loading…
Cancel
Save