Skip to content

Commit

Permalink
GMLAS: avoid null pointer dereference on some schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Apr 14, 2019
1 parent a9f32fb commit c0856bd
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions gdal/ogr/ogrsf_frmts/gmlas/ogrgmlasschemaanalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,17 +1002,21 @@ bool GMLASSchemaAnalyzer::Analyze(GMLASXSDCache& oCache,
{
bool bSimpleEnoughOut = true;
int nSubCountSubEltOut = 0;
FindElementsWithMustBeToLevel(
osXPath,
poCT->getParticle()->getModelGroupTerm(),
0,
oSetVisitedEltDecl,
oSetVisitedModelGroups,
oVectorEltsForTopClass,
aoSetXPathEltsForTopClass,
poModel,
bSimpleEnoughOut,
nSubCountSubEltOut );
auto poParticle = poCT->getParticle();
if( poParticle )
{
FindElementsWithMustBeToLevel(
osXPath,
poParticle->getModelGroupTerm(),
0,
oSetVisitedEltDecl,
oSetVisitedModelGroups,
oVectorEltsForTopClass,
aoSetXPathEltsForTopClass,
poModel,
bSimpleEnoughOut,
nSubCountSubEltOut );
}
}
}
}
Expand Down

0 comments on commit c0856bd

Please sign in to comment.