Skip to content

Commit

Permalink
isea: really fix integer overflow of https://bugs.chromium.org/p/oss-…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Mar 24, 2019
1 parent d089e17 commit 36beda5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/projections/isea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ static void hexbin2(double width, double x, double y, long *i, long *j) {
iy = lround(ry);
rz = floor(z + 0.5);
iz = lround(rz);
if( fabs(rx + ry) > std::numeric_limits<int>::max() ||
fabs(rx + ry + rz) > std::numeric_limits<int>::max() ) {
if( fabs((double)ix + iy) > std::numeric_limits<int>::max() ||
fabs((double)ix + iy + iz) > std::numeric_limits<int>::max() ) {
throw "Integer overflow";
}

Expand Down

0 comments on commit 36beda5

Please sign in to comment.