]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/336
authorCristy <urban-warrior@imagemagick.org>
Fri, 30 Dec 2016 17:15:55 +0000 (12:15 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 30 Dec 2016 17:15:55 +0000 (12:15 -0500)
MagickWand/display.c

index 8616595b89707913c897bdddb162bf0e268b3bd7..337b133753dfae3f87acf3425b40bbc6796b91ef 100644 (file)
@@ -509,9 +509,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
           continue;
         AppendImageStack(images);
         FinalizeImageSettings(image_info,image,MagickFalse);
-        iterations=0;
-        if (i == (ssize_t) argc)
-          iterations=image->iterations;
+        iterations=image->iterations;
         image_list=CloneImageList(image,exception);
         if (image_list == (Image *) NULL)
           ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
@@ -652,8 +650,12 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
           }
         if (resource_info.window_id != (char *) NULL)
           state|=ExitState;
-        if ((iterations != 0) && (++iteration == (ssize_t) iterations))
-          state|=ExitState;
+        if (iterations != 0)
+          {
+            if (++iteration == (ssize_t) iterations)
+              state|=ExitState;
+            i=0;
+          }
         if (LocaleCompare(filename,"-") == 0)
           state|=ExitState;
         RemoveAllImageStack();
@@ -674,10 +676,11 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowDisplayException(OptionError,"MissingArgument",option);
-            type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]);
+            type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
+              argv[i]);
             if (type < 0)
-              ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelOption",
-                argv[i]);
+              ThrowDisplayException(OptionError,
+                "UnrecognizedAlphaChannelOption",argv[i]);
             break;
           }
         if (LocaleCompare("antialias",option+1) == 0)