tif_pixarlog.c: avoid false positive Coverity Scan warnings about overflow. CID 1400300 and 1400367

This commit is contained in:
Even Rouault 2019-03-23 11:20:18 +01:00
parent d0358fdbc3
commit c12b6a2a39
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D

View File

@ -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;