Crash when MagickNewImage params are incorrect
Posted: 2008-12-29T07:02:40-07:00
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;
}
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 ()
Thanks!