GraphicsMagick: ReadHEIFImage() Avoid Coverity gripe about ignor...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.8082.1691596332.1439.graphicsmagick-commit@lists.sourceforge.net>
changeset 7d011aea3026 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=7d011aea3026
summary: ReadHEIFImage() Avoid Coverity gripe about ignore_transformations is always 1 for old libheif versions

diffstat:

 ChangeLog          |  5 +++++
 coders/heif.c      |  6 +++++-
 www/Changelog.html |  4 ++++
 3 files changed, 14 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 7137fc4987bd -r 7d011aea3026 ChangeLog
--- a/ChangeLog	Wed Aug 09 10:39:15 2023 -0500
+++ b/ChangeLog	Wed Aug 09 10:52:03 2023 -0500
@@ -1,5 +1,10 @@
 2023-08-09  Bob Friesenhahn  <[email protected]>
 
+	* coders/heif.c (ReadHEIFImage): For libheif versions <
+	0x01090000, ignore_transformations is always 1. Add a conditional
+	check to avoid Coverity 384803 "Logically dead code" for old
+	versions.
+
 	* coders/identity.c (ReadIdentityImage): Check the return value
 	from AllocateImageColormap().  Addresses Coverity 384802
 	"Unchecked return value".
diff -r 7137fc4987bd -r 7d011aea3026 coders/heif.c
--- a/coders/heif.c	Wed Aug 09 10:39:15 2023 -0500
+++ b/coders/heif.c	Wed Aug 09 10:52:03 2023 -0500
@@ -614,7 +614,11 @@
   progress_user_data.progress = 0;
 
   /* version 1 options */
-  decode_options->ignore_transformations = ignore_transformations == MagickTrue ? 1 : 0;
+#if LIBHEIF_NUMERIC_VERSION >= 0x01090000
+  decode_options->ignore_transformations = (ignore_transformations == MagickTrue) ? 1 : 0;
+#else
+  decode_options->ignore_transformations = 1;
+#endif
 #if HEIF_ENABLE_PROGRESS_MONITOR
   decode_options->start_progress = start_progress;
   decode_options->on_progress = on_progress;
diff -r 7137fc4987bd -r 7d011aea3026 www/Changelog.html
--- a/www/Changelog.html	Wed Aug 09 10:39:15 2023 -0500
+++ b/www/Changelog.html	Wed Aug 09 10:52:03 2023 -0500
@@ -40,6 +40,10 @@
 <p>2023-08-09  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>coders/heif.c (ReadHEIFImage): For libheif versions &lt;
+0x01090000, ignore_transformations is always 1. Add a conditional
+check to avoid Coverity 384803 &quot;Logically dead code&quot; for old
+versions.</p></li>
 <li><p>coders/identity.c (ReadIdentityImage): Check the return value
 from AllocateImageColormap().  Addresses Coverity 384802
 &quot;Unchecked return value&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.