aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaryam ebrahimzadeh <me22bee@outlook.com>2021-08-23 14:35:01 -0400
committerPeter Ross <pross@xvid.org>2021-08-26 17:06:57 +1000
commitad88cce3f8d0c8808522d2c93eaeaba904e764a5 (patch)
tree7ed360aee8bffb8da35c2d289ad0ddb237a96316
parentafeefb306e89b3ea3eb8ac8227996dc79589b669 (diff)
downloadffmpeg-ad88cce3f8d0c8808522d2c93eaeaba904e764a5.tar.gz
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>
-rw-r--r--libavcodec/vp6.c4
1 files changed, 3 insertions, 1 deletions
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)