[prev in list] [next in list] [prev in thread] [next in thread]
List: mapserver-commits
Subject: [mapserver-commits] r7332 - branches/branch-5-0/mapserver
From: svn () osgeo ! org (svn () osgeo ! org)
Date: 2008-01-30 17:17:24
Message-ID: 20080130221723.334FDE006AB () lists ! osgeo ! org
[Download RAW message or body]
Author: tamas
Date: 2008-01-30 17:17:23 -0500 (Wed, 30 Jan 2008)
New Revision: 7332
Modified:
branches/branch-5-0/mapserver/maplabel.c
Log:
fix segfault in mapserv if STYLE is not definied (#2347)
Modified: branches/branch-5-0/mapserver/maplabel.c
===================================================================
--- branches/branch-5-0/mapserver/maplabel.c 2008-01-30 19:59:35 UTC (rev 7331)
+++ branches/branch-5-0/mapserver/maplabel.c 2008-01-30 22:17:23 UTC (rev 7332)
@@ -153,8 +153,14 @@
msInitShape(cacheslot->markers[i].poly);
/* TO DO: at the moment only checks the bottom style, perhaps should check all \
of them */
- if(msGetMarkerSize(&map->symbolset, classPtr->styles[0], &w, &h, \
layerPtr->scalefactor) != MS_SUCCESS)
- return(MS_FAILURE);
+ /* #2347: after RFC-24 classPtr->styles could be NULL so we check it */
+ if (classPtr->styles != NULL) {
+ if(msGetMarkerSize(&map->symbolset, classPtr->styles[0], &w, &h, \
layerPtr->scalefactor) != MS_SUCCESS) + return(MS_FAILURE);
+ } else {
+ msSetError(MS_MISCERR, "msAddLabel error: missing style definition for layer \
'%s'", "msAddLabel()", layerPtr->name); + return(MS_FAILURE);
+ }
rect.minx = MS_NINT(point->x - .5 * w);
rect.miny = MS_NINT(point->y - .5 * h);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic