MagickIdentifyImage + pseudo image crash

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
Danack
Posts: 73
Joined: 2013-10-14T10:00:25-07:00
Authentication code: 6789

MagickIdentifyImage + pseudo image crash

Post by Danack »

Hi,

Calling MagickIdentifyImage on an image created through MagickNewImage appears to crash with the message:
identify: magick/magick.c:662: GetMagickMimeType: Assertion `magick_info != (MagickInfo *) ((void *)0)' failed.
about to identifyAborted
Code example is below, or can be downloaded from https://github.com/Danack/imagemagickte ... identify.c where there is also a terrible make file (make identify') in the unlikely event that you need that. Apparently setting an image format when creating the image is a work-around to avoid the issue.

Code: Select all

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

void ThrowWandException(MagickWand *wand) {
    char *description; 
    ExceptionType severity; 
    description = MagickGetException(wand, &severity); 
    (void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); 
    description=(char *) MagickRelinquishMemory(description); 
    exit(-1); 
}


int main(int argc,char **argv) {
    
    MagickBooleanType status;
    
    MagickWand *magick_wand, *pseudo_wand;
    char *filename;
        
    MagickWandGenesis();
    
    
    PixelWand *pixel_wand = NULL;
    pixel_wand = NewPixelWand();    
    PixelSetColor(pixel_wand, "white");
    
    
    magick_wand = NewMagickWand();

  
    int columns = 16;
    int rows = 16;
    
    status = MagickNewImage(magick_wand, columns, rows, pixel_wand);
    if (status == MagickFalse) {
        ThrowWandException(magick_wand);
    }

    char *identify;
    identify = MagickIdentifyImage (magick_wand);

    //Never gets here

    magick_wand = DestroyMagickWand(magick_wand);
    MagickWandTerminus();
    
    return(0);
}

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

Re: MagickIdentifyImage + pseudo image crash

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-2 Beta, available by sometime tomorrow. Thanks.
Post Reply