Ticket #1654 (closed defect: wontfix)

Opened 7 years ago

Last modified 7 years ago

Antialias causes segmentation fault

Reported by: michele.manzato@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer CGI Version: 4.8
Severity: normal Keywords:
Cc:

Description

 

Attachments

ms.zip Download (138.2 KB) - added by michele.manzato@… 7 years ago.
Mapfile and data to reproduce bug

Change History

Changed 7 years ago by michele.manzato@…

Mapfile and data to reproduce bug

Changed 7 years ago by michele.manzato@…

Hi all, 
 
I keep running into a "segmentation fault" when using antialiased lines. 
Attached to the report is a minimal test case including test data (streets) and 
a mapfile. 
 
After some experiments I found that the segfault may be related to something 
particular in the underlying shapefile data. The mapfile includes a different 
map extent where the segfault does not happen. 
 
Also a funny thing is that the segfault is not triggered if the line width is 
set to 2. 
 
The bug occurs both in mapserver CGI and PHP mapscript (4.8.1), so I expect it 
to be related to mapserver core and/or side libraries. My main context: 
- mapserver 4.8.1 (compiled from Mapserver site sources) 
- gdal/ogr 1.3.1 (GDAL site sources) 
- libgd2 2.0.33 (mandrake RPMs) 
 
(Sorry for the fragmented report, this is my first time here.) 
 
Mapserver is great, thanks so much for your help. 
Mik 
 

Changed 7 years ago by sdlime

GD only support "true" antialiasing with width=1 lines. With width > 1 fuzzy 
brushes are used create the antialiasing affect. 

Bottom line is that there is a problem (a big problem) in GD itself where 
bounds checking is not done (aa lines only). The fix is simple, but must be 
applied to GD itself, not MapServer. I'll post in this bug later today.

Steve

Changed 7 years ago by sdlime

  • status changed from new to closed
  • resolution set to wontfix
In gd.c,  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);

It's a one line change to gd.c. Marking as WONTFIX for now...

Steve
Note: See TracTickets for help on using tickets.