aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-24 22:21:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:53:29 +0200
commit40f056abed4e0b0bc8e037da8b56bcb93d5660f2 (patch)
tree5927cb09355d513d9de851c5f56768f7f46a6629 /libavcodec
parentf149875325cd1d3f8d0f0fa28971e8acccb390d9 (diff)
downloadffmpeg-40f056abed4e0b0bc8e037da8b56bcb93d5660f2.tar.gz
avcodec/exr: Check ymin vs. h
Fixes: out of array access Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344 Fixes: 27443/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5631239813595136 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 3e5959b3457f7f1856d997261e6ac672bba49e8b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/exr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 4c70e7b054..ec1967ad0c 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1811,7 +1811,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
ptr = picture->data[0];
// Zero out the start if ymin is not 0
- for (y = 0; y < s->ymin; y++) {
+ for (y = 0; y < FFMIN(s->ymin, s->h); y++) {
memset(ptr, 0, out_line_size);
ptr += picture->linesize[0];
}