File tree 1 file changed +14
-6
lines changed
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -4224,14 +4224,15 @@ void GDALDeserializeGCPListFromXML(CPLXMLNode *psGCPList,
4224
4224
return true ;
4225
4225
};
4226
4226
4227
+ bool bOK = true ;
4227
4228
if (!ParseDoubleValue (" Pixel" , psGCP->dfGCPPixel ))
4228
- continue ;
4229
+ bOK = false ;
4229
4230
if (!ParseDoubleValue (" Line" , psGCP->dfGCPLine ))
4230
- continue ;
4231
+ bOK = false ;
4231
4232
if (!ParseDoubleValue (" X" , psGCP->dfGCPX ))
4232
- continue ;
4233
+ bOK = false ;
4233
4234
if (!ParseDoubleValue (" Y" , psGCP->dfGCPY ))
4234
- continue ;
4235
+ bOK = false ;
4235
4236
const char *pszZ = CPLGetXMLValue (psXMLGCP, " Z" , nullptr );
4236
4237
if (pszZ == nullptr )
4237
4238
{
@@ -4245,10 +4246,17 @@ void GDALDeserializeGCPListFromXML(CPLXMLNode *psGCPList,
4245
4246
{
4246
4247
CPLError (CE_Failure, CPLE_AppDefined,
4247
4248
" GCP#Z=%s is an invalid value" , pszZ);
4248
- continue ;
4249
+ bOK = false ;
4249
4250
}
4250
4251
4251
- (*pnGCPCount)++;
4252
+ if (!bOK)
4253
+ {
4254
+ GDALDeinitGCPs (1 , psGCP);
4255
+ }
4256
+ else
4257
+ {
4258
+ (*pnGCPCount)++;
4259
+ }
4252
4260
}
4253
4261
}
4254
4262
You can’t perform that action at this time.
0 commit comments