Crash when MagickNewImage params are incorrect

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Crash when MagickNewImage params are incorrect

Post by mkoppanen »

Code: Select all

#include <stdlib.h>
#include <wand/MagickWand.h>


int main() {

        MagickWand *wand;
        PixelWand *color;

        MagickWandGenesis();

        wand = NewMagickWand();
        color = NewPixelWand();


        PixelSetColor(color, "white");


        MagickNewImage(wand, 0, 75, color);


        MagickWandTerminus();
        return 0;
}
Here is a backtrace:

Code: Select all

(gdb) run
Starting program: /home/mikko/a.out 
[Thread debugging using libthread_db enabled]
[New Thread -1215785280 (LWP 12767)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215785280 (LWP 12767)]
MagickNewImage (wand=0x804cec8, width=0, height=75, background=0x804a2c0) at wand/magick-image.c:6461
6461      if (images->exception.severity != UndefinedException)
(gdb) bt
#0  MagickNewImage (wand=0x804cec8, width=0, height=75, background=0x804a2c0) at wand/magick-image.c:6461
#1  0x080485cf in main ()
Tested with 6.4.5, might be fixed in current.

Thanks!
Mikko Koppanen
My blog: http://valokuva.org
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Crash when MagickNewImage params are incorrect

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.4.8-3 Beta available sometime tomorrow. Thanks.
Post Reply