Commit 9ffa4949 authored by maryam ebrahimzadeh's avatar maryam ebrahimzadeh Committed by 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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 89505d38
......@@ -53,9 +53,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment