GraphicsMagick: MogrifyImage(): Validate the number of -random-t...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.3138.1685754622.1565.graphicsmagick-commit@lists.sourceforge.net>
changeset 91f43cb66057 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=91f43cb66057
summary: MogrifyImage(): Validate the number of -random-threshold arguments

diffstat:

 ChangeLog        |  5 +++++
 magick/command.c |  5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (29 lines):

diff -r 23656d0d72cb -r 91f43cb66057 ChangeLog
--- a/ChangeLog	Fri Jun 02 19:51:34 2023 -0500
+++ b/ChangeLog	Fri Jun 02 20:10:13 2023 -0500
@@ -1,5 +1,10 @@
 2023-06-02  Bob Friesenhahn  <[email protected]>
 
+	* magick/command.c (MogrifyImage): Validate the number of
+	-random-threshold arguments.  Addresses SourceForge issue #700
+	Segmentation Violation in gm (magick/utility.c:3399 in
+	LocaleCompare)".
+
 	* magick/montage.c (MontageImages): Report exception if tile
 	geometry component is zero. Addresses SourceForge issue #699
 	"Floating Point Exception in gm (magick/montage.c:514 in
diff -r 23656d0d72cb -r 91f43cb66057 magick/command.c
--- a/magick/command.c	Fri Jun 02 19:51:34 2023 -0500
+++ b/magick/command.c	Fri Jun 02 20:10:13 2023 -0500
@@ -10670,6 +10670,11 @@
             /*
               Threshold image.
             */
+            if (i+2 > argc)
+              {
+                ThrowException(&(*image)->exception,OptionError,MissingArgument,option+1);
+                break;
+              }
             (void) RandomChannelThresholdImage(*image,argv[i+1],argv[i+2],
                 &(*image)->exception);
             i+=2;
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.