Floating-point exception in QueryMagickColor
Posted: 2008-08-21T16:09:07-07:00
The bogus color "#OOOOOO" (capital oh, not zero) causes a floating-point exception in QueryMagickColor. Of course it's easy to fix my code but I thought you'd want to know about it.
Here's the reproduction:
Here's the reproduction:
Code: Select all
/*
gcc `Magick-config --cflags --cppflags` 000000.c `Magick-config --ldflags --libs` -o 000000
*/
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include "magick/MagickCore.h"
int main(int argc,char **argv)
{
const char *version;
MagickPixelPacket color;
ExceptionInfo exception;
MagickCoreGenesis("000000", MagickFalse);
version = GetMagickVersion(NULL);
fputs(version, stderr); fputc('\n', stderr);
GetExceptionInfo(&exception);
GetMagickPixelPacket(NULL, &color);
(void) QueryMagickColor("#OOOOOO", &color, &exception);
DestroyExceptionInfo(&exception);
MagickCoreTerminus();
exit(0);
}