Message ID | PAXP193MB126210FDE0FF39805CE78C38B6F99@PAXP193MB1262.EURP193.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,v1,01/10] return value check for init_get_bits in wmv2dec.c | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | fail | Make failed |
andriy/PPC64_make | warning | Make failed |
On Thu, Aug 12, 2021 at 6:53 AM maryam ebrahimzadeh <me22bee@outlook.com> wrote: > > --- > libavcodec/vp6.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c > index 73822a00f9..149daa59f3 100644 > --- a/libavcodec/vp6.c > +++ b/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<<3)/8); > + if (ret < 0) > + return ret; << 3 and / 8 just negate each other. - Hendrik
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 73822a00f9..149daa59f3 100644 --- a/libavcodec/vp6.c +++ b/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<<3)/8); + if (ret < 0) + return ret; } else { ret = ff_vp56_init_range_decoder(&s->cc, buf, buf_size); if (ret < 0)