Message ID | PAXP193MB1262754D7E01B6438F860874B6C49@PAXP193MB1262.EURP193.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,v3,1/1] avcodec/vp6: return value check for init_get_bits | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
ping.
On Mon, Aug 23, 2021 at 02:35:01PM -0400, maryam ebrahimzadeh wrote: > 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. > --- > libavcodec/vp6.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c > index 73822a00f9..d024370793 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); > + if (ret < 0) > + return ret; > } else { > ret = ff_vp56_init_range_decoder(&s->cc, buf, buf_size); > if (ret < 0) > -- > 2.17.1 looks good, please apply. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
Thanks, So when will you apply this?
On Thu, Aug 26, 2021 at 05:08:15AM +0000, Maryam Ebrahimzadeh wrote: > Thanks, > So when will you apply this? applied. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 73822a00f9..d024370793 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); + if (ret < 0) + return ret; } else { ret = ff_vp56_init_range_decoder(&s->cc, buf, buf_size); if (ret < 0)