]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/832
authorCristy <urban-warrior@imagemagick.org>
Mon, 9 Oct 2017 23:28:54 +0000 (19:28 -0400)
committerCristy <urban-warrior@imagemagick.org>
Mon, 9 Oct 2017 23:28:54 +0000 (19:28 -0400)
coders/psd.c
filters/analyze.c

index 7bf385607f3889bd69722d2dbe90d71d9f6fe66b..50308659be8d3af8ecd0b49d82500d894254a9a3 100644 (file)
@@ -2030,6 +2030,8 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
       (double) psd_info.columns,(double) psd_info.rows,(double)
       psd_info.channels,(double) psd_info.depth,ModeToString((PSDImageType)
       psd_info.mode));
+  if (EOFBlob(image) != MagickFalse)
+    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
   /*
     Initialize image.
   */
@@ -2191,6 +2193,8 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
   /*
     If we are only "pinging" the image, then we're done - so return.
   */
+  if (EOFBlob(image) != MagickFalse)
+    ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
   if (image_info->ping != MagickFalse)
     {
       (void) CloseBlob(image);
index 57b89004dc2742ffc945a30083cd61a9d86b635d..9ebef8f19376065a7648c72e6af86ba1892ffeb4 100644 (file)
@@ -146,7 +146,7 @@ ModuleExport size_t analyzeImage(Image **images,const int argc,
     image_view=AcquireVirtualCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
     #pragma omp parallel for schedule(static,4) shared(status) \
-      magick_threads(image,image,image->rows,1)
+      magick_number_threads(image,image,image->rows,1)
 #endif
     for (y=0; y < (ssize_t) image->rows; y++)
     {