avcodec/tiff: Avoid 0.0/0.0 in camera_xyz_coeff()

Fixes: division by zero
Fixes: 52230/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5922608915021824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/388/head
Michael Niedermayer 2 years ago
parent b2c1a0fc2b
commit ff2d1bbe73
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/tiff.c

@ -1896,6 +1896,8 @@ static void camera_xyz_coeff(TiffContext *s,
for (i = 0; i < 3; i++) {
for (num = j = 0; j < 3; j++)
num += cam2rgb[i][j];
if (!num)
num = 1;
for (j = 0; j < 3; j++)
cam2rgb[i][j] /= num;
s->premultiply[i] = 1.f / num;

Loading…
Cancel
Save