ffmpeg | branch: master | Michael Niedermayer <[email protected]> | Sun 
Dec 18 00:51:45 2022 +0100| [44f45711ccbc6bdfcc047402d0e30eb7f3d6214c] | 
committer: Michael Niedermayer

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 <[email protected]>

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

 libavcodec/tiff.c | 6 ++++--
 1 file 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++) {

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to