Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/448
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Apr 26, 2017
1 parent 4c6289b commit 23071f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions coders/pcd.c
Expand Up @@ -541,12 +541,15 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception)
overview=LocaleNCompare((char *) header,"PCD_OPA",7) == 0;
if ((count != (3*0x800)) ||
((LocaleNCompare((char *) header+0x800,"PCD",3) != 0) && (overview == 0)))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
{
header=(unsigned char *) RelinquishMagickMemory(header);
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
}
rotate=header[0x0e02] & 0x03;
number_images=(header[10] << 8) | header[11];
header=(unsigned char *) RelinquishMagickMemory(header);
if (number_images > 65535)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
header=(unsigned char *) RelinquishMagickMemory(header);
/*
Determine resolution by scene specification.
*/
Expand Down Expand Up @@ -686,7 +689,7 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception)
}
image->colorspace=YCCColorspace;
if (LocaleCompare(image_info->magick,"PCDS") == 0)
SetImageColorspace(image,sRGBColorspace);
(void) SetImageColorspace(image,sRGBColorspace);
if (j < (ssize_t) number_images)
{
/*
Expand Down Expand Up @@ -840,7 +843,7 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception)
image->gamma=1.000f/2.200f;
image->colorspace=YCCColorspace;
if (LocaleCompare(image_info->magick,"PCDS") == 0)
SetImageColorspace(image,sRGBColorspace);
(void) SetImageColorspace(image,sRGBColorspace);
return(GetFirstImageInList(image));
}

Expand Down

0 comments on commit 23071f8

Please sign in to comment.