]> granicus.if.org Git - imagemagick/commitdiff
Make it more clear what is being read.
authorDirk Lemstra <dirk@lemstra.org>
Sat, 26 Jan 2019 11:55:47 +0000 (12:55 +0100)
committerDirk Lemstra <dirk@lemstra.org>
Sat, 26 Jan 2019 11:55:47 +0000 (12:55 +0100)
coders/psd.c

index 7bbd3af4ea75f822ffcd5e61f2b0060ab6dc4d2b..ab68c3d9cb556c63da1c5cae03ae24da03d95bbe 100644 (file)
@@ -1735,18 +1735,22 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
   for (i=0; i < number_layers; i++)
   {
     ssize_t
-      x,
-      y;
+      top,
+      left,
+      bottom,
+      right;
 
     if (image->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "  reading layer #%.20g",(double) i+1);
-    layer_info[i].page.y=(ssize_t) ReadBlobSignedLong(image);
-    layer_info[i].page.x=(ssize_t) ReadBlobSignedLong(image);
-    y=(ssize_t) ReadBlobSignedLong(image);
-    x=(ssize_t) ReadBlobSignedLong(image);
-    layer_info[i].page.width=(size_t) (x-layer_info[i].page.x);
-    layer_info[i].page.height=(size_t) (y-layer_info[i].page.y);
+    top=(ssize_t) ReadBlobSignedLong(image);
+    left=(ssize_t) ReadBlobSignedLong(image);
+    bottom=(ssize_t) ReadBlobSignedLong(image);
+    right=(ssize_t) ReadBlobSignedLong(image);
+    layer_info[i].page.y=top;
+    layer_info[i].page.x=left;
+    layer_info[i].page.width=(size_t) (right-left);
+    layer_info[i].page.height=(size_t) (bottom-top);
     layer_info[i].channels=ReadBlobShort(image);
     if (layer_info[i].channels > MaxPSDChannels)
       {