mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-25 00:05:03 -04:00
Fix crash in geometry collections with negative part numbers
This commit is contained in:
parent
b2bd0ac182
commit
0e908d5d5b
@ -449,7 +449,7 @@ bool QgsGeometryCollection::insertVertex( QgsVertexId position, const QgsPoint &
|
|||||||
|
|
||||||
bool QgsGeometryCollection::moveVertex( QgsVertexId position, const QgsPoint &newPos )
|
bool QgsGeometryCollection::moveVertex( QgsVertexId position, const QgsPoint &newPos )
|
||||||
{
|
{
|
||||||
if ( position.part >= mGeometries.size() )
|
if ( position.part < 0 || position.part >= mGeometries.size() )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -464,7 +464,7 @@ bool QgsGeometryCollection::moveVertex( QgsVertexId position, const QgsPoint &ne
|
|||||||
|
|
||||||
bool QgsGeometryCollection::deleteVertex( QgsVertexId position )
|
bool QgsGeometryCollection::deleteVertex( QgsVertexId position )
|
||||||
{
|
{
|
||||||
if ( position.part >= mGeometries.size() )
|
if ( position.part < 0 || position.part >= mGeometries.size() )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -613,7 +613,7 @@ QgsAbstractGeometry *QgsGeometryCollection::segmentize( double tolerance, Segmen
|
|||||||
|
|
||||||
double QgsGeometryCollection::vertexAngle( QgsVertexId vertex ) const
|
double QgsGeometryCollection::vertexAngle( QgsVertexId vertex ) const
|
||||||
{
|
{
|
||||||
if ( vertex.part >= mGeometries.size() )
|
if ( vertex.part < 0 || vertex.part >= mGeometries.size() )
|
||||||
{
|
{
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user