diff --git a/ogr/ogrlinestring.cpp b/ogr/ogrlinestring.cpp index b48431a395cf..80445fea3b6d 100644 --- a/ogr/ogrlinestring.cpp +++ b/ogr/ogrlinestring.cpp @@ -395,7 +395,12 @@ bool OGRSimpleCurve::setNumPoints(int nNewPointCount, int bZeroizeNewContent) if (nNewPointCount > std::numeric_limits::max() / static_cast(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::max() / + static_cast(sizeof(OGRRawPoint))); return false; }