mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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>
(cherry picked from commit 9ffa49496d
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1e198bd926
commit
bc9e0b6cd2
@ -50,9 +50,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_config(&m4ac, buf, size * 8, 1);
|
||||
if (off < 0)
|
||||
return off;
|
||||
|
Loading…
Reference in New Issue
Block a user