Fixes: out of array access Fixes: 20828/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APM_fuzzer-5712770106654720
Unified · Split
| @@ -154,9 +154,9 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) · 153 unmodified lines | ||
| 154 | 154 | case AV_CODEC_ID_ADPCM_IMA_APM: |
| 155 | 155 | if (avctx->extradata && avctx->extradata_size >= 16) { |
| 156 | 156 | c->status[0].predictor = AV_RL32(avctx->extradata + 0); |
| 157 | − c->status[0].step_index = AV_RL32(avctx->extradata + 4); | |
| 157 | + c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 4), 0, 88); | |
| 158 | 158 | c->status[1].predictor = AV_RL32(avctx->extradata + 8); |
| 159 | − c->status[1].step_index = AV_RL32(avctx->extradata + 12); | |
| 159 | + c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 12), 0, 88); | |
| 160 | 160 | } |
| 161 | 161 | break; |
| 162 | 162 | case AV_CODEC_ID_ADPCM_IMA_WS: |