diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-25 00:23:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-11 21:23:49 +0200 |
commit | af1a0cedb22c287cdc79f230082d9fec87a9823a (patch) | |
tree | b66d74e26113a5c7073c66e8bcc2bad390b43428 /libavcodec/exr.c | |
parent | ae9919bb6c0b45973aba012f86ba42486a7e25bb (diff) | |
download | ffmpeg-af1a0cedb22c287cdc79f230082d9fec87a9823a.tar.gz |
avcodec/exr: skip bottom clearing loop when its outside the image
Fixes: signed integer overflow: 1633771809 * 32960 cannot be represented in type 'int'
Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344
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/exr.c')
-rw-r--r-- | libavcodec/exr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index aec9505eb9..8dbe9e2696 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1819,10 +1819,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, avctx->execute2(avctx, decode_block, s->thread_data, NULL, nb_blocks); // Zero out the end if ymax+1 is not h - ptr = picture->data[0] + ((s->ymax+1) * picture->linesize[0]); - for (y = s->ymax + 1; y < avctx->height; y++) { - memset(ptr, 0, out_line_size); - ptr += picture->linesize[0]; + if ((s->ymax+1) < avctx->height) { + ptr = picture->data[0] + ((s->ymax+1) * picture->linesize[0]); + for (y = s->ymax + 1; y < avctx->height; y++) { + memset(ptr, 0, out_line_size); + ptr += picture->linesize[0]; + } } picture->pict_type = AV_PICTURE_TYPE_I; |