Skip to content

Commit

Permalink
set mRectEngine on filterType FilterFid as well and check the mRectEn…
Browse files Browse the repository at this point in the history
…ginge in case of ExactIntersect and FilterFid to avoid crash
  • Loading branch information
signedav committed Feb 15, 2021
1 parent e9623a4 commit 2942bc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/virtual/qgsvirtuallayerfeatureiterator.cpp
Expand Up @@ -118,8 +118,8 @@ QgsVirtualLayerFeatureIterator::QgsVirtualLayerFeatureIterator( QgsVirtualLayerF
else // never return a feature if the id is negative
offset = QStringLiteral( " LIMIT 0" );
}
else if ( !mFilterRect.isNull() &&
mRequest.flags() & QgsFeatureRequest::ExactIntersect )
if ( !mFilterRect.isNull() &&
mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
// if an exact intersection is requested, prepare the geometry to intersect
QgsGeometry rectGeom = QgsGeometry::fromRect( mFilterRect );
Expand Down Expand Up @@ -327,7 +327,7 @@ bool QgsVirtualLayerFeatureIterator::fetchFeature( QgsFeature &feature )

// if the FilterRect has not been applied on the query
// apply it here by skipping features until they intersect
if ( mSource->mDefinition.uid().isNull() && mRequest.filterType() != QgsFeatureRequest::FilterFid && feature.hasGeometry() && mSource->mDefinition.hasDefinedGeometry() && !mFilterRect.isNull() )
if ( mSource->mDefinition.uid().isNull() && feature.hasGeometry() && mSource->mDefinition.hasDefinedGeometry() && !mFilterRect.isNull() )
{
if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
Expand Down

0 comments on commit 2942bc3

Please sign in to comment.