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 almost 11 years ago. Updated almost 11 years ago.

Status:Closed
Priority:High
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

Description

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 82151833
Added by Jürgen Fischer almost 11 years ago

Merge pull request #1057 from elpaso/master

Fix #9306

History

#1 Updated by Giovanni Manghi almost 11 years ago

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

#2 Updated by Jürgen Fischer almost 11 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF