mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
avcodec/atrac3plus: Check split point in fill mode 3
Fixes: index 32 out of bounds for type 'int [32]'
Fixes: 18350/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3P_fuzzer-5643794862571520
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit de5102fd92)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -456,6 +456,10 @@ static int decode_channel_wordlen(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
|
|||||||
} else if (chan->fill_mode == 3) {
|
} else if (chan->fill_mode == 3) {
|
||||||
pos = ch_num ? chan->num_coded_vals + chan->split_point
|
pos = ch_num ? chan->num_coded_vals + chan->split_point
|
||||||
: ctx->num_quant_units - chan->split_point;
|
: ctx->num_quant_units - chan->split_point;
|
||||||
|
if (pos > FF_ARRAY_ELEMS(chan->qu_wordlen)) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Split point beyond array\n");
|
||||||
|
pos = FF_ARRAY_ELEMS(chan->qu_wordlen);
|
||||||
|
}
|
||||||
for (i = chan->num_coded_vals; i < pos; i++)
|
for (i = chan->num_coded_vals; i < pos; i++)
|
||||||
chan->qu_wordlen[i] = 1;
|
chan->qu_wordlen[i] = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user