Floating-point exception in QueryMagickColor

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
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Floating-point exception in QueryMagickColor

Post by rmagick »

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:

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);
}

User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Floating-point exception in QueryMagickColor

Post by magick »

The problem you reported is fixed in the subversion trunk. Look for it also in the next point release.
Post Reply