tif_pixarlog.c: avoid false positive Coverity Scan warnings about overflow. CID 1400300 and 1400367
This commit is contained in:
parent
d0358fdbc3
commit
c12b6a2a39
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user