]> granicus.if.org Git - imagemagick/commitdiff
Always perform a seek after reading the mask to fix https://github.com/ImageMagick...
authordirk <dirk@git.imagemagick.org>
Tue, 14 Jun 2016 19:52:05 +0000 (21:52 +0200)
committerdirk <dirk@git.imagemagick.org>
Tue, 14 Jun 2016 19:52:05 +0000 (21:52 +0200)
coders/psd.c

index a516f37c7c5e2e993fd97c0cdf4c414ec2f6e77b..56845480ec7fe3917d1b343be8f66585f6999ecd 100644 (file)
@@ -1186,7 +1186,7 @@ static MagickBooleanType ReadPSDChannel(Image *image,const PSDInfo *psd_info,
     channel_image=mask;
   }
 
-  offset=TellBlob(channel_image);
+  offset=TellBlob(image);
   status=MagickTrue;
   switch(compression)
   {
@@ -1222,17 +1222,16 @@ static MagickBooleanType ReadPSDChannel(Image *image,const PSDInfo *psd_info,
 #endif
       break;
     default:
-      SeekBlob(image,offset+layer_info->channel_info[channel].size-2,SEEK_SET);
       (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning,
         "CompressionNotSupported","'%.20g'",(double) compression);
       break;
   }
 
+  SeekBlob(image,offset+layer_info->channel_info[channel].size-2,SEEK_SET);
   if (status == MagickFalse)
     {
       if (mask != (Image *) NULL)
         DestroyImage(mask);
-      SeekBlob(image,offset+layer_info->channel_info[channel].size-2,SEEK_SET);
       ThrowBinaryException(CoderError,"UnableToDecompressImage",
         image->filename);
     }