Skip to content

Commit bdb5727

Browse files
committedJan 17, 2018
[server] Use std::numeric_limits instead of INT_MAX
1 parent 74d76d5 commit bdb5727

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎src/server/services/wms/qgswmsrenderer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,14 +1854,13 @@ namespace QgsWms
18541854

18551855
const int bytes_per_line = ( ( width * depth + 31 ) >> 5 ) << 2; // bytes per scanline (must be multiple of 4)
18561856

1857-
if ( INT_MAX / depth < width
1857+
if ( std::numeric_limits<int>::max() / depth < ( uint )width
18581858
|| bytes_per_line <= 0
18591859
|| height <= 0
1860-
|| INT_MAX / uint( bytes_per_line ) < height
1861-
|| INT_MAX / sizeof( uchar * ) < uint( height ) )
1860+
|| std::numeric_limits<int>::max() / uint( bytes_per_line ) < ( uint )height
1861+
|| std::numeric_limits<int>::max() / sizeof( uchar * ) < uint( height ) )
18621862
return false;
18631863

1864-
18651864
return true;
18661865
}
18671866

0 commit comments

Comments
 (0)
Please sign in to comment.