[mapserver-commits] r9330 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Sep 22 11:12:05 EDT 2009


Author: assefa
Date: 2009-09-22 11:12:03 -0400 (Tue, 22 Sep 2009)
New Revision: 9330

Modified:
   trunk/mapserver/mapfile.c
Log:
avoid crash when symbol is not found

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2009-09-21 22:20:59 UTC (rev 9329)
+++ trunk/mapserver/mapfile.c	2009-09-22 15:12:03 UTC (rev 9330)
@@ -4879,22 +4879,25 @@
             styleObj *style = class->styles[k];
             if(style->symbol != 0) {
               symbolObj *symbol = map->symbolset.symbol[style->symbol];
-              if(style->gap == 0)
-                style->gap = symbol->gap;
-              if(style->patternlength == 0) {
-                int idx;
-                style->patternlength = symbol->patternlength;
-                for(idx=0;idx<style->patternlength;idx++)
-                  style->pattern[idx] = (double)(symbol->pattern[idx]);
+              if (symbol)
+              {
+                  if(style->gap == 0)
+                    style->gap = symbol->gap;
+                  if(style->patternlength == 0) {
+                      int idx;
+                      style->patternlength = symbol->patternlength;
+                      for(idx=0;idx<style->patternlength;idx++)
+                        style->pattern[idx] = (double)(symbol->pattern[idx]);
+                  }
+                  if(style->position == MS_CC)
+                    style->position = symbol->position;
+                  if(style->linecap == MS_CJC_ROUND)
+                    style->linecap = symbol->linecap;
+                  if(style->linejoin == MS_CJC_NONE)
+                    style->linejoin = symbol->linejoin;
+                  if(style->linejoinmaxsize == 3)
+                    style->linejoinmaxsize = symbol->linejoinmaxsize;
               }
-              if(style->position == MS_CC)
-                style->position = symbol->position;
-              if(style->linecap == MS_CJC_ROUND)
-                style->linecap = symbol->linecap;
-              if(style->linejoin == MS_CJC_NONE)
-                style->linejoin = symbol->linejoin;
-              if(style->linejoinmaxsize == 3)
-                style->linejoinmaxsize = symbol->linejoinmaxsize;
             }
           }
         }



More information about the mapserver-commits mailing list