From c7681650a7a217d456fa6d0080398a403cf8ebaf Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Thu, 9 Jan 2025 16:20:49 +0100 Subject: [PATCH] return geom field seal error --- ogr/ogrgeomfielddefn.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ogr/ogrgeomfielddefn.cpp b/ogr/ogrgeomfielddefn.cpp index aacece2482b2..9942cf2c8ec1 100644 --- a/ogr/ogrgeomfielddefn.cpp +++ b/ogr/ogrgeomfielddefn.cpp @@ -565,6 +565,15 @@ OGRSpatialReferenceH OGR_GFld_GetSpatialRef(OGRGeomFieldDefnH hDefn) */ void OGRGeomFieldDefn::SetSpatialRef(const OGRSpatialReference *poSRSIn) { + + if (m_bSealed) + { + CPLError( + CE_Failure, CPLE_AppDefined, + "OGRGeomFieldDefn::SetSpatialRef() not allowed on a sealed object"); + return; + } + if (poSRS == poSRSIn) { return;