diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-24 22:21:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-11 21:23:48 +0200 |
commit | 00115573e3030eff57847e1045ec18f0da5adb5c (patch) | |
tree | 2c21f7e07d6d38ab02d1d15adfee25a197db0a1d | |
parent | caefd7a3ba9fd48f1204d9b16a4e619fb85c4aa6 (diff) | |
download | ffmpeg-00115573e3030eff57847e1045ec18f0da5adb5c.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>
-rw-r--r-- | libavcodec/exr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 14bb4b40e9..aec9505eb9 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1809,7 +1809,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]; } |