aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/sonic.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-04 01:18:13 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-04 02:14:10 +0200
commit6ae1a32d8ac7b20099b35ff376ac92dd793b1852 (patch)
tree4df257833f69c257a8007f3fabb05d48ede104ff /libavcodec/sonic.c
parenta51d4246d8ac96acee735e7e5dedb9d9ef27a594 (diff)
downloadffmpeg-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.c5
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) {