[mapserver-commits] r7525 - branches/branch-5-0/mapserver
svn at osgeo.org
svn at osgeo.org
Thu Apr 17 13:41:17 EDT 2008
Author: sdlime
Date: 2008-04-17 13:41:17 -0400 (Thu, 17 Apr 2008)
New Revision: 7525
Modified:
branches/branch-5-0/mapserver/mapgd.c
Log:
Avoid segfault associated with not finding a palette file. (bug 2577)
Modified: branches/branch-5-0/mapserver/mapgd.c
===================================================================
--- branches/branch-5-0/mapserver/mapgd.c 2008-04-17 17:37:35 UTC (rev 7524)
+++ branches/branch-5-0/mapserver/mapgd.c 2008-04-17 17:41:17 UTC (rev 7525)
@@ -3595,10 +3595,10 @@
const char *palette = msGetOutputFormatOption( format, "PALETTE", "palette.txt");
gdPImg = msImageCreateWithPaletteGD(img, palette, gdImageSX(img), gdImageSY(img));
+ if(!gdPImg) return MS_FAILURE;
msImageCopyForcePaletteGD(img, gdPImg);
-
gdImagePngCtx(gdPImg, ctx);
gdImageDestroy(gdPImg);
} else if( force_pc256 ) {
@@ -3698,6 +3698,7 @@
const char *palette = msGetOutputFormatOption( format, "PALETTE", "palette.txt");
gdPImg = msImageCreateWithPaletteGD(img, palette, gdImageSX(img), gdImageSY(img));
+ if(!gdPImg) return NULL;
msImageCopyForcePaletteGD(img, gdPImg);
imgbytes = gdImagePngPtr(gdPImg, size_ptr);
More information about the mapserver-commits
mailing list