]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/967
authorCristy <urban-warrior@imagemagick.org>
Sun, 11 Feb 2018 18:59:23 +0000 (13:59 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 11 Feb 2018 18:59:23 +0000 (13:59 -0500)
MagickCore/accelerate.c
coders/pwp.c

index 6bcb5a84f32ecb32d96f32a460d1832a184cb3c6..f20826b2558e35633310c0a6e37a19dd82003206 100644 (file)
@@ -4325,7 +4325,7 @@ static Image *ComputeResizeImage(const Image* image,MagickCLEnv clEnv,
   for (i = 0; i < 7; i++)
     coefficientBuffer[i]=(float) resizeFilterCoefficient[i];
   cubicCoefficientsBuffer=CreateOpenCLBuffer(device,CL_MEM_COPY_HOST_PTR |
-    CL_MEM_READ_ONLY,7*sizeof(*resizeFilterCoefficient),&coefficientBuffer);
+    CL_MEM_READ_ONLY,7*sizeof(*cubicCoefficientsBuffer),&coefficientBuffer);
   if (cubicCoefficientsBuffer == (cl_mem) NULL)
   {
     (void) OpenCLThrowMagickException(device,exception,GetMagickModule(),
index ac3693f53a16027d009b2c00b2c6b741cd2bfba4..89e7a2194485bee1c751489b5be004a686de5595 100644 (file)
@@ -121,6 +121,9 @@ static MagickBooleanType IsPWP(const unsigned char *magick,const size_t length)
 */
 static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
 {
+  char
+    filename[MagickPathExtent];
+
   FILE
     *file;
 
@@ -178,7 +181,9 @@ static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
   (void) SetImageInfoProgressMonitor(read_info,(MagickProgressMonitor) NULL,
     (void *) NULL);
   SetImageInfoBlob(read_info,(void *) NULL,0);
-  unique_file=AcquireUniqueFileResource(read_info->filename);
+  unique_file=AcquireUniqueFileResource(filename);
+  (void) FormatLocaleString(read_info->filename,MagickPathExtent,"sfw:%s",
+    filename);
   for ( ; ; )
   {
     (void) memset(magick,0,sizeof(magick));
@@ -192,13 +197,13 @@ static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
     }
     if (c == EOF)
       {
-        (void) RelinquishUniqueFileResource(read_info->filename);
+        (void) RelinquishUniqueFileResource(filename);
         read_info=DestroyImageInfo(read_info);
         ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
       }
     if (LocaleNCompare((char *) (magick+12),"SFW94A",6) != 0)
       {
-        (void) RelinquishUniqueFileResource(read_info->filename);
+        (void) RelinquishUniqueFileResource(filename);
         read_info=DestroyImageInfo(read_info);
         ThrowReaderException(CorruptImageError,"ImproperImageHeader");
       }
@@ -210,7 +215,7 @@ static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
       file=fdopen(unique_file,"wb");
     if ((unique_file == -1) || (file == (FILE *) NULL))
       {
-        (void) RelinquishUniqueFileResource(read_info->filename);
+        (void) RelinquishUniqueFileResource(filename);
         read_info=DestroyImageInfo(read_info);
         ThrowFileException(exception,FileOpenError,"UnableToWriteFile",
           image->filename);
@@ -230,7 +235,7 @@ static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
     (void) fclose(file);
     if (c == EOF)
       {
-        (void) RelinquishUniqueFileResource(read_info->filename);
+        (void) RelinquishUniqueFileResource(filename);
         read_info=DestroyImageInfo(read_info);
         ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
       }
@@ -261,7 +266,7 @@ static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
   }
   if (unique_file != -1)
     (void) close(unique_file);
-  (void) RelinquishUniqueFileResource(read_info->filename);
+  (void) RelinquishUniqueFileResource(filename);
   read_info=DestroyImageInfo(read_info);
   if (image != (Image *) NULL)
     {