GraphicsMagick: ImportViewPixelArea(): Fix Coverity issue 381868...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.14660.1667940491.1459.graphicsmagick-commit@lists.sourceforge.net>
changeset 280593e8b49c in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=280593e8b49c
summary: ImportViewPixelArea(): Fix Coverity issue 381868 Control flow issues (DEADCODE)"

diffstat:

 ChangeLog          |  3 +++
 magick/export.c    |  2 +-
 magick/import.c    |  4 +++-
 www/Changelog.html |  2 ++
 4 files changed, 9 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r 6c26fcb005d1 -r 280593e8b49c ChangeLog
--- a/ChangeLog	Tue Nov 08 14:38:48 2022 -0600
+++ b/ChangeLog	Tue Nov 08 14:48:00 2022 -0600
@@ -1,5 +1,8 @@
 2022-11-08  Bob Friesenhahn  <[email protected]>
 
+	* magick/import.c (ImportViewPixelArea): Fix Coverity issue 381868
+	"Control flow issues (DEADCODE)".
+
 	* magick/blob.c (DetachBlob): Do not dereference blob_info->data
 	if it is null.  Addresses Coverity issue 381869 "Null pointer
 	dereferences (FORWARD_NULL)".
diff -r 6c26fcb005d1 -r 280593e8b49c magick/export.c
--- a/magick/export.c	Tue Nov 08 14:38:48 2022 -0600
+++ b/magick/export.c	Tue Nov 08 14:48:00 2022 -0600
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2003 - 2018 GraphicsMagick Group
+  Copyright (C) 2003 - 2022 GraphicsMagick Group
   Copyright (C) 2002 ImageMagick Studio
 
   This program is covered by multiple licenses, which are described in
diff -r 6c26fcb005d1 -r 280593e8b49c magick/import.c
--- a/magick/import.c	Tue Nov 08 14:38:48 2022 -0600
+++ b/magick/import.c	Tue Nov 08 14:48:00 2022 -0600
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2003 - 2018 GraphicsMagick Group
+  Copyright (C) 2003 - 2022 GraphicsMagick Group
   Copyright (C) 2002 ImageMagick Studio
 
   This program is covered by multiple licenses, which are described in
@@ -3610,11 +3610,13 @@
           /* Multiply to scale up */
           unsigned_scale=(MaxRGB / (MaxRGB >> (QuantumDepth-sample_bits)));
         }
+#if QuantumDepth < 32
       else if (QuantumDepth < sample_bits)
         {
           /* Divide to scale down */
           unsigned_scale=(unsigned_maxvalue/MaxRGB);
         }
+#endif
     }
 
   image=GetCacheViewImage(view);
diff -r 6c26fcb005d1 -r 280593e8b49c www/Changelog.html
--- a/www/Changelog.html	Tue Nov 08 14:38:48 2022 -0600
+++ b/www/Changelog.html	Tue Nov 08 14:48:00 2022 -0600
@@ -40,6 +40,8 @@
 <p>2022-11-08  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>
 <blockquote>
 <ul class="simple">
+<li><p>magick/import.c (ImportViewPixelArea): Fix Coverity issue 381868
+&quot;Control flow issues (DEADCODE)&quot;.</p></li>
 <li><p>magick/blob.c (DetachBlob): Do not dereference blob_info-&gt;data
 if it is null.  Addresses Coverity issue 381869 &quot;Null pointer
 dereferences (FORWARD_NULL)&quot;.</p></li>
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.