mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-28 14:01:27 +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;
|
SonicContext *s = avctx->priv_data;
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int i;
|
int i;
|
||||||
|
int ret;
|
||||||
|
|
||||||
s->channels = avctx->channels;
|
s->channels = avctx->channels;
|
||||||
s->samplerate = avctx->sample_rate;
|
s->samplerate = avctx->sample_rate;
|
||||||
@ -868,7 +869,9 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
|
|||||||
return AVERROR_INVALIDDATA;
|
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);
|
s->version = get_bits(&gb, 2);
|
||||||
if (s->version >= 2) {
|
if (s->version >= 2) {
|
||||||
|
Loading…
Reference in New Issue
Block a user