Commit 6ae1a32d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/sonic: Check init_get_bits8() for failure

Fixes: CID1322310
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a51d4246
...@@ -858,6 +858,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx) ...@@ -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) ...@@ -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) {
......
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