mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
avcodec/sonic: Check init_get_bits8() for failure
Fixes: CID1322310 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a51d4246d8
commit
6ae1a32d8a
@ -858,6 +858,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
|
||||
SonicContext *s = avctx->priv_data;
|
||||
GetBitContext gb;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
s->channels = avctx->channels;
|
||||
s->samplerate = avctx->sample_rate;
|
||||
@ -868,7 +869,9 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
|
||||
ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
s->version = get_bits(&gb, 2);
|
||||
if (s->version >= 2) {
|
||||
|
Loading…
Reference in New Issue
Block a user