[mapserver-commits] r9437 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sat Oct 10 11:01:45 EDT 2009


Author: tamas
Date: 2009-10-10 11:01:44 -0400 (Sat, 10 Oct 2009)
New Revision: 9437

Modified:
   trunk/mapserver/maplabel.c
Log:
Fix msGetLabelSize causing access violation when the img parameter is NULL  (#3157)

Modified: trunk/mapserver/maplabel.c
===================================================================
--- trunk/mapserver/maplabel.c	2009-10-09 21:49:13 UTC (rev 9436)
+++ trunk/mapserver/maplabel.c	2009-10-10 15:01:44 UTC (rev 9437)
@@ -779,8 +779,14 @@
     char *font=NULL;
 
     size = label->size*scalefactor;
-    size = MS_MAX(size, label->minsize*img->resolutionfactor);
-    size = MS_MIN(size, label->maxsize*img->resolutionfactor);
+    if (img != NULL) {
+      size = MS_MAX(size, label->minsize*img->resolutionfactor);
+      size = MS_MIN(size, label->maxsize*img->resolutionfactor);
+    }
+    else {
+      size = MS_MAX(size, label->minsize);
+      size = MS_MIN(size, label->maxsize);
+    }
     scalefactor = size / label->size;
     font = msLookupHashTable(&(fontset->fonts), label->font);
     if(!font) {



More information about the mapserver-commits mailing list