Bug report #9306

mapserver GetMap segfaults when OPACITIES is set and an external SLD and is provided but not for all layers

Added by Alessandro Pasotti about 9 years ago. Updated about 9 years ago.

Assignee:Alessandro Pasotti
Category:QGIS Server
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:17914


Here is a patch, I'll provide it in a PR.

For the impatients:

diff --git a/src/mapserver/qgswmsserver.cpp b/src/mapserver/qgswmsserver.cpp
index 89e7614..0debfaf 100644
--- a/src/mapserver/qgswmsserver.cpp
+++ b/src/mapserver/qgswmsserver.cpp
@@ -2194,7 +2194,7 @@ void QgsWMSServer::applyOpacities( const QStringList& layerList, QList< QPair< Q
   QList< QPair< QgsMapLayer*, int > > layerOpacityList;
   QStringList::const_iterator oIt = opacityList.constBegin();
   QStringList::const_iterator lIt = layerList.constBegin();
-  for ( ; oIt != opacityList.constEnd(); ++oIt, ++lIt )
+  for ( ; oIt != opacityList.constEnd() && lIt != layerList.constEnd(); ++oIt, ++lIt )
     //get layer list for
     int opacity = oIt->toInt();

Associated revisions

Revision bd77ecc2
Added by Alessandro Pasotti about 9 years ago

Fix #9306 and getStyles

Revision 82151833
Added by Jürgen Fischer about 9 years ago

Merge pull request #1057 from elpaso/master

Fix #9306


#1 Updated by Giovanni Manghi about 9 years ago

  • Target version set to Future Release - High Priority
  • Priority changed from Normal to High

#2 Updated by Jürgen Fischer about 9 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF