Skip to content
Permalink
Browse files

Fix crash on QMap iteration in Qt5

  • Loading branch information
wonder-sk committed Sep 12, 2016
1 parent 4fa3191 commit 02599356a09a69b7c1f49851d3f424fcfa4a5651
Showing with 19 additions and 3 deletions.
  1. +19 −3 src/providers/wms/qgswmscapabilities.cpp
@@ -2157,9 +2157,25 @@ const QgsWmtsTileMatrix *QgsWmtsTileMatrixSet::findOtherResolution( double tres,
QMap<double, QgsWmtsTileMatrix>::const_iterator it = tileMatrices.constFind( tres );
if ( it == tileMatrices.constEnd() )
return nullptr;
it += offset;
if ( it == tileMatrices.constEnd() )
return nullptr;
while ( 1 )
{
if ( offset > 0 )
{
++it;
--offset;
}
else if ( offset < 0 )
{
if ( it == tileMatrices.constBegin() )
return nullptr;
--it;
++offset;
}
else
break;

if ( it == tileMatrices.constEnd() )
return nullptr;
}
return &it.value();
}

0 comments on commit 0259935

Please sign in to comment.
You can’t perform that action at this time.