Skip to content

Commit

Permalink
Merge pull request #11038 from ThinkSpatial/too-many-points-error-mes…
Browse files Browse the repository at this point in the history
…sage

Improve error message when OGRSimpleCurve point limit is exceeded
  • Loading branch information
rouault authored Oct 17, 2024
2 parents 5033ea2 + c8b56f3 commit c044df7
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 c044df7

Please sign in to comment.