summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-21 23:27:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-01 00:41:28 +0200
commit447c1942ced390eaf04267cfa2c41e38c5c2e686 (patch)
treea1e9b10ec13ed6171332f2a288d957d875e47800 /libavcodec
parentb821f224fbc509b9b665af36bfa631cf18cd97c1 (diff)
downloadffmpeg-447c1942ced390eaf04267cfa2c41e38c5c2e686.tar.gz
avcodec/tiff: Check tile_length and tile_width
Fixes: Division by 0 Fixes: 49235/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5495613847896064 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 76112c2b4167bb3c40503b3334c8b38fd707a8d5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/tiff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 7190f48310..34aab924d3 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -963,6 +963,9 @@ static int dng_decode_tiles(AVCodecContext *avctx, AVFrame *frame,
int pos_x = 0, pos_y = 0;
int ret;
+ if (s->tile_width <= 0 || s->tile_length <= 0)
+ return AVERROR_INVALIDDATA;
+
has_width_leftover = (s->width % s->tile_width != 0);
has_height_leftover = (s->height % s->tile_length != 0);