Important! 1 pixel anti-aliasing seg. faults...

Steve Lime steve.lime at DNR.STATE.MN.US
Tue Feb 14 12:35:43 EST 2006


Hi all: There have been a number of users reporting issues with 1 pixel wide antialiasing
seg. faults and version 4.8.  There is a problem with GD.  The library does not properly
check pixel values against the image size which can result in a buffer overflow in some
cases. The GD author is aware of the problem but has not released a fix yet- no idea
why since it is a pretty severe error.

Anyway, to use 1 pixel-wide antialiasing you *MUST* apply a small fix to GD. Fortunately 
the fix is a one-liner. 

In gd.c,  function gdImageSetAAPixelColor() change:

int dr,dg,db,p,r,g,b;

p = gdImageGetPixel(im,x,y);

to:

int dr,dg,db,p,r,g,b;

if (!gdImageBoundsSafeMacro (im, x, y)) return;

p = gdImageGetPixel(im,x,y);

I can put together a patch version of the gd-2.033 source if folks are interested.

Steve



More information about the mapserver-users mailing list