[FFmpeg-devel] [PATCH v2 1/1] return value check for init_get_bits in adts_decode_extradata
maryam ebrahimzadeh
me22bee at outlook.com
Wed Aug 4 23:08:53 EEST 2021
version2:
As second argument for init_get_bits (buf) can be crafted, return value check for this function call is necessary.
'buf' is part of 'AVPacket pkt'.
replace init_get_bits with init_get_bits8.
---
libavformat/adtsenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index b660618432..3924e678d9 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -55,7 +55,7 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui
MPEG4AudioConfig m4ac;
int off, ret;
- ret = init_get_bits(&gb, buf, size * 8);
+ ret = init_get_bits8(&gb, buf, size);
if (ret < 0)
return ret;
off = avpriv_mpeg4audio_get_config2(&m4ac, buf, size, 1, s);
--
2.17.1
More information about the ffmpeg-devel
mailing list