Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/350
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jan 10, 2017
1 parent eadf2e4 commit d4ec73f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions coders/psd.c
Expand Up @@ -1118,8 +1118,7 @@ static MagickBooleanType ReadPSDChannelRLE(Image *image,const PSDInfo *psd_info,
if (length > row_size + 256) // arbitrary number
{
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
ThrowBinaryException(ResourceLimitError,"InvalidLength",
image->filename);
ThrowBinaryException(ResourceLimitError,"InvalidLength",image->filename);
}

compact_pixels=(unsigned char *) AcquireQuantumMemory(length,sizeof(*pixels));
Expand Down Expand Up @@ -1660,8 +1659,8 @@ ModuleExport MagickBooleanType ReadPSDLayers(Image *image,
if (DiscardBlobBytes(image,(MagickSizeType) (length-18)) == MagickFalse)
{
layer_info=DestroyLayerInfo(layer_info,number_layers);
ThrowBinaryException(CorruptImageError,"UnexpectedEndOfFile",
image->filename);
ThrowBinaryException(CorruptImageError,
"UnexpectedEndOfFile",image->filename);
}
}
length=ReadBlobLong(image);
Expand Down Expand Up @@ -2602,8 +2601,7 @@ static unsigned char *AcquireCompactPixels(const Image *image,
if (compact_pixels == (unsigned char *) NULL)
{
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'",
image->filename);
ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
}
return(compact_pixels);
}
Expand Down Expand Up @@ -2634,7 +2632,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info,
compact_pixels=(unsigned char *) NULL;
if (next_image->compression == RLECompression)
{
compact_pixels=AcquireCompactPixels(image,exception);
compact_pixels=AcquireCompactPixels(next_image,exception);
if (compact_pixels == (unsigned char *) NULL)
return(0);
}
Expand Down

0 comments on commit d4ec73f

Please sign in to comment.