[FFmpeg-cvslog] avcodec/vp6: return value check for init_get_bits
maryam ebrahimzadeh
git at videolan.org
Thu Aug 26 10:08:07 EEST 2021
ffmpeg | branch: master | maryam ebrahimzadeh <me22bee at outlook.com> | Mon Aug 23 14:35:01 2021 -0400| [ad88cce3f8d0c8808522d2c93eaeaba904e764a5] | committer: Peter Ross
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 at xvid.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad88cce3f8d0c8808522d2c93eaeaba904e764a5
---
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)
More information about the ffmpeg-cvslog
mailing list