diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-12-18 00:51:45 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-01-11 12:12:26 +0100 |
commit | 44f45711ccbc6bdfcc047402d0e30eb7f3d6214c (patch) | |
tree | a31fe98a97e0de019deaf95f7dbc5f911258bed3 /libavcodec | |
parent | 1b59de3770b2e3f7f44ec4adba27c88b79adaaec (diff) | |
download | ffmpeg-44f45711ccbc6bdfcc047402d0e30eb7f3d6214c.tar.gz |
avcodec/tiff: Check camera_calibration for 0
Fixes: division by 0
Fixes: 53926/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5680347889401856
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')
-rw-r--r-- | libavcodec/tiff.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 41b5a6b7e4..820457fedc 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -2050,8 +2050,10 @@ again: } if (!s->use_color_matrix) { - for (i = 0; i < 3; i++) - s->premultiply[i] /= s->camera_calibration[i][i]; + for (i = 0; i < 3; i++) { + if (s->camera_calibration[i][i]) + s->premultiply[i] /= s->camera_calibration[i][i]; + } } else { for (int c = 0; c < 3; c++) { for (i = 0; i < 3; i++) { |