Page 1 of 1

Crash when MagickNewImage params are incorrect

Posted: 2008-12-29T07:02:40-07:00
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!

Re: Crash when MagickNewImage params are incorrect

Posted: 2008-12-29T07:24:03-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.4.8-3 Beta available sometime tomorrow. Thanks.