Skip to content

Commit 9ffa494

Browse files
maryam ebrahimzadehmichaelni
maryam ebrahimzadeh
authored andcommitted
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@niedermayer.cc>
1 parent 89505d3 commit 9ffa494

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: libavformat/adtsenc.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui
5353
GetBitContext gb;
5454
PutBitContext pb;
5555
MPEG4AudioConfig m4ac;
56-
int off;
56+
int off, ret;
5757

58-
init_get_bits(&gb, buf, size * 8);
58+
ret = init_get_bits8(&gb, buf, size);
59+
if (ret < 0)
60+
return ret;
5961
off = avpriv_mpeg4audio_get_config2(&m4ac, buf, size, 1, s);
6062
if (off < 0)
6163
return off;

0 commit comments

Comments
 (0)