[FFmpeg-cvslog] avcodec/tiff: Check tile_length and tile_width

Michael Niedermayer git at videolan.org
Fri Jul 22 19:10:56 EEST 2022


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 21 23:27:59 2022 +0200| [6fbd4d22859bbf7b8b1d27a722efd8947688b5ce] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 76112c2b4167bb3c40503b3334c8b38fd707a8d5)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fbd4d22859bbf7b8b1d27a722efd8947688b5ce
---

 libavcodec/tiff.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index bf69b083b3..2d40626ccc 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -965,6 +965,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);
 



More information about the ffmpeg-cvslog mailing list