Bug report #9306
mapserver GetMap segfaults when OPACITIES is set and an external SLD and is provided but not for all layers
| Status: | Closed | ||
|---|---|---|---|
| Priority: | High | ||
| Assignee: | |||
| 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();
History
#1
Updated by Giovanni Manghi almost 12 years ago
- Target version set to Future Release - High Priority
- Priority changed from Normal to High
#2
Updated by Jürgen Fischer almost 12 years ago
- Status changed from In Progress to Closed
Fixed in changeset 821518337188d55ee31e4fcb42d4ac8e92b5f9ce.