diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-04 01:18:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-04 02:14:10 +0200 |
commit | 6ae1a32d8ac7b20099b35ff376ac92dd793b1852 (patch) | |
tree | 4df257833f69c257a8007f3fabb05d48ede104ff /libavcodec/sonic.c | |
parent | a51d4246d8ac96acee735e7e5dedb9d9ef27a594 (diff) | |
download | ffmpeg-6ae1a32d8ac7b20099b35ff376ac92dd793b1852.tar.gz |
avcodec/sonic: Check init_get_bits8() for failure
Fixes: CID1322310
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/sonic.c')
-rw-r--r-- | libavcodec/sonic.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 4506379cf5..4ec7d89fde 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -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) { |