diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-04-16 17:51:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-05-01 00:48:32 +0200 |
commit | e2e34c7731372b65b41ddb11334ccaeba4a76f13 (patch) | |
tree | e65f35149c71c4dda0415788a7fd23641cd6aa79 /libavcodec | |
parent | 957106a24d2960e1d0359a1774b547c1292b4704 (diff) | |
download | ffmpeg-e2e34c7731372b65b41ddb11334ccaeba4a76f13.tar.gz |
avcodec/wavarc: Check order before using it to write the list
Fixes: out of array access
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6247711015043072
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6487578428964864
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6651587794960384
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6686265824378880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wavarc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c index 896972cec8..827803c91d 100644 --- a/libavcodec/wavarc.c +++ b/libavcodec/wavarc.c @@ -343,6 +343,8 @@ static int decode_2slp(AVCodecContext *avctx, break; case 0: order = get_urice(gb, 2); + if ((unsigned)order >= FF_ARRAY_ELEMS(s->filter[ch])) + return AVERROR_INVALIDDATA; for (int o = 0; o < order; o++) s->filter[ch][o] = get_srice(gb, 2); for (int n = 0; n < s->nb_samples; n++) { |