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>
This commit is contained in:
Michael Niedermayer 2022-12-18 00:51:45 +01:00
parent 1b59de3770
commit 44f45711cc
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -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++) {