Remove unused locals. Remove locals to avoid shadowing.
(fn_rsvg_handle_free): Remove; unused.
(svg_load, svg_load_image): Fix pointer signedness problem.
+ (imagemagick_load_image): Don't use garbage pointer image_wand.
* ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
im_image = ReadImage (image_info, exception);
DestroyExceptionInfo (exception);
- if (im_image != NULL)
- {
- image_wand = NewMagickWandFromImage (im_image);
- DestroyImage(im_image);
- status = MagickTrue;
- }
- else
- status = MagickFalse;
+ if (im_image == NULL)
+ goto imagemagick_no_wand;
+ image_wand = NewMagickWandFromImage (im_image);
+ DestroyImage(im_image);
}
else
{
image_wand = NewMagickWand ();
- status = MagickReadImageBlob (image_wand, contents, size);
+ if (MagickReadImageBlob (image_wand, contents, size) == MagickFalse)
+ goto imagemagick_error;
}
- if (status == MagickFalse) goto imagemagick_error;
-
/* If width and/or height is set in the display spec assume we want
to scale to those values. If either h or w is unspecified, the
unspecified should be calculated from the specified to preserve
imagemagick_error:
DestroyMagickWand (image_wand);
+ imagemagick_no_wand:
MagickWandTerminus ();
/* TODO more cleanup. */
image_error ("Error parsing IMAGEMAGICK image `%s'", img->spec, Qnil);