Skip to content
Permalink
Browse files Browse the repository at this point in the history
https://github.com/ImageMagick/ImageMagick/issues/715
  • Loading branch information
Cristy committed Aug 31, 2017
1 parent 13663fd commit bdbbb13
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions coders/ps.c
Expand Up @@ -657,6 +657,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (count != 1)
continue;
length=extent;
if (length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
profile=BlobToStringInfo((const void *) NULL,length);
if (profile != (StringInfo *) NULL)
{
Expand Down Expand Up @@ -724,8 +726,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Note spot names.
*/
(void) FormatLocaleString(property,MagickPathExtent,"ps:SpotColor-%.20g",
(double) (spotcolor++));
(void) FormatLocaleString(property,MagickPathExtent,
"ps:SpotColor-%.20g",(double) (spotcolor++));
for (q=command; *q != '\0'; q++)
if (isspace((int) (unsigned char) *q) != 0)
break;
Expand Down Expand Up @@ -895,7 +897,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
(IsStringTrue(option) != MagickFalse))
(void) ConcatenateMagickString(options,"-dEPSCrop ",MagickPathExtent);
if (fitPage != MagickFalse)
(void) ConcatenateMagickString(options,"-dEPSFitPage ",MagickPathExtent);
(void) ConcatenateMagickString(options,"-dEPSFitPage ",
MagickPathExtent);
}
(void) CopyMagickString(filename,read_info->filename,MagickPathExtent);
(void) AcquireUniqueFilename(filename);
Expand Down Expand Up @@ -1043,6 +1046,7 @@ ModuleExport size_t RegisterPSImage(void)
entry->decoder=(DecodeImageHandler *) ReadPSImage;
entry->encoder=(EncodeImageHandler *) WritePSImage;
entry->magick=(IsImageFormatHandler *) IsPS;
entry->flags|=CoderDecoderSeekableStreamFlag;
entry->flags^=CoderAdjoinFlag;
entry->flags^=CoderBlobSupportFlag;
entry->mime_type=ConstantString("application/postscript");
Expand All @@ -1051,6 +1055,7 @@ ModuleExport size_t RegisterPSImage(void)
entry->decoder=(DecodeImageHandler *) ReadPSImage;
entry->encoder=(EncodeImageHandler *) WritePSImage;
entry->magick=(IsImageFormatHandler *) IsPS;
entry->flags|=CoderDecoderSeekableStreamFlag;
entry->flags^=CoderAdjoinFlag;
entry->flags^=CoderBlobSupportFlag;
entry->mime_type=ConstantString("application/postscript");
Expand All @@ -1059,6 +1064,7 @@ ModuleExport size_t RegisterPSImage(void)
entry->decoder=(DecodeImageHandler *) ReadPSImage;
entry->encoder=(EncodeImageHandler *) WritePSImage;
entry->magick=(IsImageFormatHandler *) IsPS;
entry->flags|=CoderDecoderSeekableStreamFlag;
entry->flags^=CoderAdjoinFlag;
entry->flags^=CoderBlobSupportFlag;
entry->mime_type=ConstantString("application/postscript");
Expand All @@ -1068,6 +1074,7 @@ ModuleExport size_t RegisterPSImage(void)
entry->decoder=(DecodeImageHandler *) ReadPSImage;
entry->encoder=(EncodeImageHandler *) WritePSImage;
entry->magick=(IsImageFormatHandler *) IsPS;
entry->flags|=CoderDecoderSeekableStreamFlag;
entry->flags^=CoderAdjoinFlag;
entry->flags^=CoderBlobSupportFlag;
entry->mime_type=ConstantString("application/postscript");
Expand All @@ -1077,6 +1084,7 @@ ModuleExport size_t RegisterPSImage(void)
entry->encoder=(EncodeImageHandler *) WritePSImage;
entry->magick=(IsImageFormatHandler *) IsPS;
entry->mime_type=ConstantString("application/postscript");
entry->flags|=CoderDecoderSeekableStreamFlag;
entry->flags^=CoderBlobSupportFlag;
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
Expand Down

0 comments on commit bdbbb13

Please sign in to comment.