% July 1992 %
% %
% %
-% Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2018 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
% obtain a copy of the License at %
% %
-% http://www.imagemagick.org/script/license.php %
+% https://www.imagemagick.org/script/license.php %
% %
% Unless required by applicable law or agreed to in writing, software %
% distributed under the License is distributed on an "AS IS" BASIS, %
if (count == 4)
break;
}
- if ((count != 4) || (width == 0) || (width > 2) ||
+ if ((count != 4) || (width == 0) || (width > 3) ||
(image->columns == 0) || (image->rows == 0) ||
(image->colors == 0) || (image->colors > MaxColormapSize))
{
(void *(*)(void *)) NULL);
if (AcquireImageColormap(image,image->colors,exception) == MagickFalse)
{
+ xpm_colors=DestroySplayTree(xpm_colors);
xpm_buffer=DestroyString(xpm_buffer);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
*/
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
- return(DestroyImageList(image));
+ {
+ xpm_colors=DestroySplayTree(xpm_colors);
+ xpm_buffer=DestroyString(xpm_buffer);
+ return(DestroyImageList(image));
+ }
for (y=0; y < (ssize_t) image->rows; y++)
{
p=NextXPMLine(p);
(void) RelinquishUniqueFileResource(blob_info->filename);
blob_info=DestroyImageInfo(blob_info);
if ((picon == (Image *) NULL) || (affinity_image == (Image *) NULL))
- return(MagickFalse);
+ {
+ if (affinity_image != (Image *) NULL)
+ affinity_image=DestroyImage(affinity_image);
+ if (picon != (Image *) NULL)
+ picon=DestroyImage(picon);
+ return(MagickFalse);
+ }
quantize_info=AcquireQuantizeInfo(image_info);
status=RemapImage(quantize_info,picon,affinity_image,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
symbol[j]='\0';
(void) CopyMagickString(buffer,symbol,MagickPathExtent);
(void) WriteBlobString(image,buffer);
- p+=GetPixelChannels(image);
+ p+=GetPixelChannels(picon);
}
(void) FormatLocaleString(buffer,MagickPathExtent,"\"%s\n",
y == (ssize_t) (picon->rows-1) ? "" : ",");