avcodec/adpcm: Check init_get_bits8() for failure
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 09:47:38 +0000 (11:47 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 10:03:37 +0000 (12:03 +0200)
Fixes CID1322317

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/adpcm.c

index bcd7392..52d0d44 100644 (file)
@@ -775,7 +775,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
             int samples_per_block = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2];
             GetBitContext g;
 
-            init_get_bits8(&g, gb.buffer, bytestream2_get_bytes_left(&gb));
+            ret = init_get_bits8(&g, gb.buffer, bytestream2_get_bytes_left(&gb));
+            if (ret < 0)
+                return ret;
             for (n = 0; n < (nb_samples - 1) / samples_per_block; n++) {
                 for (i = 0; i < avctx->channels; i++) {
                     cs = &c->status[i];