]> granicus.if.org Git - imagemagick/commitdiff
Only read the requested layer (#1394).
authorDirk Lemstra <dirk@lemstra.org>
Sat, 24 Nov 2018 08:00:51 +0000 (09:00 +0100)
committerDirk Lemstra <dirk@lemstra.org>
Sat, 24 Nov 2018 08:10:21 +0000 (09:10 +0100)
coders/psd.c

index 9814c535917271100add7d2de31022cd821bbb07..5731ce1e7773d5557d7324f3e827d6b9b1e1bbec 100644 (file)
@@ -1952,7 +1952,9 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
   status=MagickTrue;
   for (i=0; i < number_layers; i++)
   {
-    if (layer_info[i].image == (Image *) NULL)
+    if ((layer_info[i].image == (Image *) NULL) ||
+        ((image_info->number_scenes != 0) && ((i < image_info->scene-1) ||
+         (i >= image_info->scene+image_info->number_scenes-1))))
       {
         for (j=0; j < (ssize_t) layer_info[i].channels; j++)
         {