Skip to content

Commit

Permalink
Merge pull request #11039 from OSGeo/backport-11038-to-release/3.10
Browse files Browse the repository at this point in the history
[Backport release/3.10] Improve error message when OGRSimpleCurve point limit is exceeded
  • Loading branch information
rouault authored Oct 17, 2024
2 parents f56bb97 + b03bf94 commit b6edddd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ogr/ogrlinestring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,12 @@ bool OGRSimpleCurve::setNumPoints(int nNewPointCount, int bZeroizeNewContent)
if (nNewPointCount > std::numeric_limits<int>::max() /
static_cast<int>(sizeof(OGRRawPoint)))
{
CPLError(CE_Failure, CPLE_IllegalArg, "Too big point count.");
CPLError(CE_Failure, CPLE_IllegalArg,
"Too many points on line/curve (%d points exceeds the "
"limit of %d points)",
nNewPointCount,
std::numeric_limits<int>::max() /
static_cast<int>(sizeof(OGRRawPoint)));
return false;
}

Expand Down

0 comments on commit b6edddd

Please sign in to comment.