Skip to content
Permalink
Browse files Browse the repository at this point in the history
Added extra check to fix #93
  • Loading branch information
dlemstra committed Feb 2, 2016
1 parent 30eec87 commit 4b1b9c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coders/psd.c
Expand Up @@ -1936,7 +1936,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (blocks == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
count=ReadBlob(image,(size_t) length,blocks);
if ((count != (ssize_t) length) ||
if ((count != (ssize_t) length) || (length < 4) ||
(LocaleNCompare((char *) blocks,"8BIM",4) != 0))
{
blocks=(unsigned char *) RelinquishMagickMemory(blocks);
Expand Down

0 comments on commit 4b1b9c0

Please sign in to comment.