diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index c6735a49c9..846ec5ef9c 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -163,9 +163,9 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) break; case AV_CODEC_ID_ADPCM_IMA_APM: if (avctx->extradata && avctx->extradata_size >= 16) { - c->status[0].predictor = AV_RL32(avctx->extradata + 0); + c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 0), 18); c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 4), 0, 88); - c->status[1].predictor = AV_RL32(avctx->extradata + 8); + c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 8), 18); c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 12), 0, 88); } break;