[mapserver-commits] r11546 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Apr 12 10:33:08 EDT 2011


Author: tbonfort
Date: 2011-04-12 07:33:08 -0700 (Tue, 12 Apr 2011)
New Revision: 11546

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapagg.cpp
   trunk/mapserver/mapdraw.c
Log:
fix segmentation fault with transparent layers containing symbols (#3834)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-04-12 13:09:11 UTC (rev 11545)
+++ trunk/mapserver/HISTORY.TXT	2011-04-12 14:33:08 UTC (rev 11546)
@@ -15,6 +15,8 @@
 Current Version (SVN trunk): 
 ---------------------------- 
 
+- fix segmentation fault with transparent layers containing symbols (#3834)
+
 - fix memory leak on tiled vector polygons
 
 - fix segfault with marker symbols on short lines (#3823)

Modified: trunk/mapserver/mapagg.cpp
===================================================================
--- trunk/mapserver/mapagg.cpp	2011-04-12 13:09:11 UTC (rev 11545)
+++ trunk/mapserver/mapagg.cpp	2011-04-12 14:33:08 UTC (rev 11546)
@@ -682,7 +682,7 @@
    else
       r->m_renderer_base.clear(AGG_NO_COLOR);
 
-   if (format->transparent || format->imagemode == MS_IMAGEMODE_RGBA ) {
+   if (!bg || format->transparent || format->imagemode == MS_IMAGEMODE_RGBA ) {
       r->use_alpha = true;
    } else {
       r->use_alpha = false;

Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2011-04-12 13:09:11 UTC (rev 11545)
+++ trunk/mapserver/mapdraw.c	2011-04-12 14:33:08 UTC (rev 11546)
@@ -664,7 +664,7 @@
 int msDrawLayer(mapObj *map, layerObj *layer, imageObj *image)
 {
   imageObj *image_draw = image;
-  outputFormatObj *transFormat = NULL, *altFormat=NULL;
+  outputFormatObj *altFormat=NULL;
   int retcode=MS_SUCCESS;
   int originalopacity = layer->opacity;
   const char *alternativeFomatString = NULL;
@@ -698,10 +698,8 @@
 	    rendererVTableObj *renderer = MS_IMAGE_RENDERER(image_draw);
 		if (layer->opacity > 0 && layer->opacity < 100) {
 			if (!renderer->supports_transparent_layers) {
-				msApplyOutputFormat(&transFormat, image->format, MS_TRUE,
-						MS_NOOVERRIDE,MS_NOOVERRIDE);
 				image_draw = msImageCreate(image->width, image->height,
-						transFormat, image->imagepath, image->imageurl, map->resolution, map->defresolution, NULL);
+						image->format, image->imagepath, image->imageurl, map->resolution, map->defresolution, NULL);
 				if (!image_draw) {
 					msSetError(MS_MISCERR, "Unable to initialize temporary transparent image.",
 							"msDrawLayer()");
@@ -755,10 +753,6 @@
 	  renderer->getRasterBufferHandle(image_draw,&rb);
 	  renderer->mergeRasterBuffer(image,&rb,layer->opacity*0.01,0,0,0,0,rb.width,rb.height);  
 	  msFreeImage(image_draw);
-
-	  /* deref and possibly free temporary transparent output format.  */
-	  msApplyOutputFormat( &transFormat, NULL, MS_NOOVERRIDE, MS_NOOVERRIDE, MS_NOOVERRIDE );
-
   }
   
   msImageEndLayer(map,layer,image);



More information about the mapserver-commits mailing list