[FFmpeg-cvslog] avformat/adtsenc: return value check for init_get_bits in adts_decode_extradata
maryam ebrahimzadeh
git at videolan.org
Wed Sep 8 22:44:08 EEST 2021
ffmpeg | branch: release/4.4 | maryam ebrahimzadeh <me22bee at outlook.com> | Wed Aug 4 16:15:18 2021 -0400| [fb993619d1035fa9646506925ea70fb122038999] | committer: Michael Niedermayer
avformat/adtsenc: return value check for init_get_bits in adts_decode_extradata
As the second argument for init_get_bits (buf) can be crafted, a return value check for this function call is necessary.
'buf' is part of 'AVPacket pkt'.
replace init_get_bits with init_get_bits8.
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9ffa49496d1aae4cbbb387aac28a9e061a6ab0a6)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb993619d1035fa9646506925ea70fb122038999
---
libavformat/adtsenc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 3595cb3bb2..c35a12a628 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -51,9 +51,11 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui
GetBitContext gb;
PutBitContext pb;
MPEG4AudioConfig m4ac;
- int off;
+ int off, 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);
if (off < 0)
return off;
More information about the ffmpeg-cvslog
mailing list