[FFmpeg-devel] [PATCH 1/4] avcodec/tiff: Ignore tile_count
Michael Niedermayer
michael at niedermayer.cc
Fri Nov 18 23:09:15 EET 2022
Fixes: out of array access
Fixes: 52427/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4849108968144896
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/tiff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index cde318d5e5..b962dce5a2 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -994,7 +994,7 @@ static int dng_decode_tiles(AVCodecContext *avctx, AVFrame *frame,
tile_count_y = (s->height + s->tile_length - 1) / s->tile_length;
/* Iterate over the number of tiles */
- for (tile_idx = 0; tile_idx < s->tile_count; tile_idx++) {
+ for (tile_idx = 0; tile_idx < tile_count_x * tile_count_y; tile_idx++) {
tile_x = tile_idx % tile_count_x;
tile_y = tile_idx / tile_count_x;
--
2.17.1
More information about the ffmpeg-devel
mailing list