Skip to content

Commit

Permalink
Merge branch 'master' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Mar 3, 2021
2 parents 5b2d67c + eac6b14 commit 9a67903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io/GDALWriter.cpp
Expand Up @@ -205,9 +205,9 @@ void GDALWriter::createGrid(BOX2D bounds)
// Validating before casting avoids float-cast-overflow undefined behavior.
double d_width = std::floor((bounds.maxx - bounds.minx) / m_edgeLength) + 1;
double d_height = std::floor((bounds.maxy - bounds.miny) / m_edgeLength) + 1;
if (d_width < 0.0 || d_width > std::numeric_limits<int>::max())
if (d_width < 0.0 || d_width > (std::numeric_limits<int>::max)())
throwError("Grid width out of range.");
if (d_height < 0.0 || d_height > std::numeric_limits<int>::max())
if (d_height < 0.0 || d_height > (std::numeric_limits<int>::max)())
throwError("Grid height out of range.");
int width = static_cast<int>(d_width);
int height = static_cast<int>(d_height);
Expand Down

0 comments on commit 9a67903

Please sign in to comment.