[prev in list] [next in list] [prev in thread] [next in thread] 

List:       imagemagick-developer
Subject:    [magick-developers] Segfault with SVG icons
From:       Mosfet <dan.duley () verizon ! net>
Date:       2003-07-07 22:26:30
[Download RAW message or body]

KDE SVG icons cause a segfault in ImageMagick, (the sighandler catches it so 
display will just exit). I've tried both 5.5.7 and CVS. 

It's an FP exception in render.c:

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 1024 (LWP 18704)]
0x413437b9 in DrawPolygonPrimitive (image=0x82a5f68, draw_info=0x82c7888,
    primitive_info=0x41ebb008) at render.c:3511
3511            fill_color=AcquireOnePixel(pattern,

Looking at the source code I've found the problem is here:

pattern=draw_info->fill_pattern;
	if (pattern != (Image *) NULL)
	fill_color=AcquireOnePixel(pattern, 
		(long) (x-pattern->extract_info.x) % pattern->columns,
		(long) (y-pattern->extract_info.y) % pattern->rows,&image->exception);

The problem is the Image isn't null but it has 0 for pattern->columns and 
pattern->rows. Changing the check to:

if(pattern != (Image *) NULL && pattern->columns && pattern->rows)

Causes it not to crash but the resulting image is only B/W because there is no 
pattern ;-)

I've uploaded the icon I'm using for testing. You can download it here (7K):

http://www.mosfet.org/svgicon.html
_______________________________________________
Magick-developers mailing list
Magick-developers@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-developers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic