From c12b6a2a39b8bf0ec51ad76a7fffe40d0b32b7a3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 23 Mar 2019 11:20:18 +0100 Subject: [PATCH] tif_pixarlog.c: avoid false positive Coverity Scan warnings about overflow. CID 1400300 and 1400367 --- libtiff/tif_pixarlog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c index 77620e3d..6998c1ba 100644 --- a/libtiff/tif_pixarlog.c +++ b/libtiff/tif_pixarlog.c @@ -640,6 +640,7 @@ PixarLogGuessDataFmt(TIFFDirectory *td) static tmsize_t multiply_ms(tmsize_t m1, tmsize_t m2) { + assert(m1 >= 0 && m2 >= 0); if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 ) return 0; return m1 * m2; @@ -648,6 +649,7 @@ multiply_ms(tmsize_t m1, tmsize_t m2) static tmsize_t add_ms(tmsize_t m1, tmsize_t m2) { + assert(m1 >= 0 && m2 >= 0); /* if either input is zero, assume overflow already occurred */ if (m1 == 0 || m2 == 0) return 0;