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;