aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/adpcm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-04 11:47:38 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-04 12:03:37 +0200
commit66a7bc0010942a3de9cf538b62245db4a5e74cbb (patch)
tree50e16f4763f18bf4657b569168bb023c8cab438e /libavcodec/adpcm.c
parentcf410f8fb94d2052909f7c2bc5c3a0eee06511ba (diff)
downloadffmpeg-66a7bc0010942a3de9cf538b62245db4a5e74cbb.tar.gz
avcodec/adpcm: Check init_get_bits8() for failure
Fixes CID1322317 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index bcd739203a..52d0d44cc2 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -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];