GraphicsMagick: MogrifyImageCommand(): Properly check argument l...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.1958.1678633199.1409.graphicsmagick-commit@lists.sourceforge.net>
changeset 9938c1222ed7 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=9938c1222ed7
summary: MogrifyImageCommand(): Properly check argument list when validating "-resample"

diffstat:

 ChangeLog          |   3 +++
 magick/command.c   |  15 ++-------------
 www/Changelog.html |   5 ++++-
 3 files changed, 9 insertions(+), 14 deletions(-)

diffs (67 lines):

diff -r d010e4255c66 -r 9938c1222ed7 ChangeLog
--- a/ChangeLog	Sun Mar 12 09:31:12 2023 -0500
+++ b/ChangeLog	Sun Mar 12 09:59:46 2023 -0500
@@ -4,6 +4,9 @@
 	-noop when the user has not provided any images.  Addresses
 	SourceForge issue #691 "Segmentation Violation in gm
 	(magick/command.c:3054)".
+	(MogrifyImageCommand): Properly check argument list when
+	validating "resample".  Addresses SourceForge issue #692
+	"Segmentation Violation in gm (GetGeometry function)".
 
 2023-03-11  Bob Friesenhahn  <[email protected]>
 
diff -r d010e4255c66 -r 9938c1222ed7 magick/command.c
--- a/magick/command.c	Sun Mar 12 09:31:12 2023 -0500
+++ b/magick/command.c	Sun Mar 12 09:59:46 2023 -0500
@@ -5792,7 +5792,7 @@
             if (*option == '-')
               {
                 i++;
-                if ((i == (argc-1)) || !IsGeometry(argv[i]))
+                if ((i == argc) || !IsGeometry(argv[i]))
                   ThrowConvertException(OptionError,MissingArgument,option);
               }
             break;
@@ -13445,16 +13445,6 @@
             if (*option == '-')
               {
                 i++;
-                if ((i == (argc-1)) || !IsGeometry(argv[i]))
-                  ThrowMogrifyException(OptionError,MissingArgument,option);
-              }
-            break;
-          }
-        if (LocaleCompare("resize",option+1) == 0)
-          {
-            if (*option == '-')
-              {
-                i++;
                 if ((i == argc) || !IsGeometry(argv[i]))
                   ThrowMogrifyException(OptionError,MissingArgument,option);
               }
@@ -13466,8 +13456,7 @@
               {
                 i++;
                 if ((i == argc) || !IsGeometry(argv[i]))
-                  ThrowMogrifyException(OptionError,MissingArgument,
-                    option);
+                  ThrowMogrifyException(OptionError,MissingArgument,option);
               }
             break;
           }
diff -r d010e4255c66 -r 9938c1222ed7 www/Changelog.html
--- a/www/Changelog.html	Sun Mar 12 09:31:12 2023 -0500
+++ b/www/Changelog.html	Sun Mar 12 09:59:46 2023 -0500
@@ -43,7 +43,10 @@
 <li><p>magick/command.c (CompositeImageCommand): Properly deal with
 -noop when the user has not provided any images.  Addresses
 SourceForge issue #691 &quot;Segmentation Violation in gm
-(magick/command.c:3054)&quot;.</p></li>
+(magick/command.c:3054)&quot;.
+(MogrifyImageCommand): Properly check argument list when
+validating &quot;resample&quot;.  Addresses SourceForge issue #692
+&quot;Segmentation Violation in gm (GetGeometry function)&quot;.</p></li>
 </ul>
 </blockquote>
 <p>2023-03-11  Bob Friesenhahn  &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.