Commit 66a7bc00 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/adpcm: Check init_get_bits8() for failure

Fixes CID1322317
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent cf410f8f
...@@ -775,7 +775,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, ...@@ -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]; int samples_per_block = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2];
GetBitContext g; 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 (n = 0; n < (nb_samples - 1) / samples_per_block; n++) {
for (i = 0; i < avctx->channels; i++) { for (i = 0; i < avctx->channels; i++) {
cs = &c->status[i]; cs = &c->status[i];
......
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