GraphicsMagick: Enforce that embedded profiles are not zero-sized.

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.79132.1626907580.1503.graphicsmagick-commit@lists.sourceforge.net>
changeset 7fd8cd0b7b07 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=7fd8cd0b7b07
summary: Enforce that embedded profiles are not zero-sized.

diffstat:

 ChangeLog                              |  10 ++++++++++
 VisualMagick/installer/inc/version.isx |   4 ++--
 coders/webp.c                          |   9 ++++++---
 magick/profile.c                       |   2 +-
 magick/version.h                       |   4 ++--
 www/Changelog.html                     |   9 +++++++++
 www/api/profile.html                   |   4 ++--
 7 files changed, 32 insertions(+), 10 deletions(-)

diffs (123 lines):

diff -r 59c8ee0db7b9 -r 7fd8cd0b7b07 ChangeLog
--- a/ChangeLog	Sun Jul 18 14:35:54 2021 -0500
+++ b/ChangeLog	Wed Jul 21 17:45:58 2021 -0500
@@ -1,3 +1,13 @@
+2021-07-21  Bob Friesenhahn  <[email protected]>
+
+        * magick/profile.c (SetImageProfile): Do not try to store a
+        zero-sized profile.
+
+        * coders/webp.c (ReadWEBPImage): Enforce that embedded profiles
+        provided by libWebP are not zero-sized. This problem was brought
+        to our attention by Shane Bishop on the graphicsmagick-help
+        mailing list.
+
 2021-07-18  Bob Friesenhahn  <[email protected]>
 
         * Makefile.am: Add support for using an external
diff -r 59c8ee0db7b9 -r 7fd8cd0b7b07 VisualMagick/installer/inc/version.isx
--- a/VisualMagick/installer/inc/version.isx	Sun Jul 18 14:35:54 2021 -0500
+++ b/VisualMagick/installer/inc/version.isx	Wed Jul 21 17:45:58 2021 -0500
@@ -10,5 +10,5 @@
 
 #define public MagickPackageName "GraphicsMagick"
 #define public MagickPackageVersion "1.4"
-#define public MagickPackageVersionAddendum ".020210718"
-#define public MagickPackageReleaseDate "snapshot-20210718"
+#define public MagickPackageVersionAddendum ".020210721"
+#define public MagickPackageReleaseDate "snapshot-20210721"
diff -r 59c8ee0db7b9 -r 7fd8cd0b7b07 coders/webp.c
--- a/coders/webp.c	Sun Jul 18 14:35:54 2021 -0500
+++ b/coders/webp.c	Wed Jul 21 17:45:58 2021 -0500
@@ -315,19 +315,22 @@
     if (webp_flags & ICCP_FLAG)
       {
         WebPMuxGetChunk(mux,"ICCP",&flag_data);
-        SetImageProfile(image,"ICC",flag_data.bytes,flag_data.size);
+        if ((flag_data.bytes != NULL) && (flag_data.size > 0))
+          SetImageProfile(image,"ICC",flag_data.bytes,flag_data.size);
       }
 
     if (webp_flags & EXIF_FLAG)
       {
         WebPMuxGetChunk(mux,"EXIF",&flag_data);
-        SetImageProfile(image,"EXIF",flag_data.bytes,flag_data.size);
+        if ((flag_data.bytes != NULL) && (flag_data.size > 0))
+          SetImageProfile(image,"EXIF",flag_data.bytes,flag_data.size);
       }
 
     if (webp_flags & XMP_FLAG)
       {
         WebPMuxGetChunk(mux,"XMP",&flag_data);
-        SetImageProfile(image,"XMP",flag_data.bytes,flag_data.size);
+        if ((flag_data.bytes != NULL) && (flag_data.size > 0))
+          SetImageProfile(image,"XMP",flag_data.bytes,flag_data.size);
       }
 
     WebPMuxDelete(mux);
diff -r 59c8ee0db7b9 -r 7fd8cd0b7b07 magick/profile.c
--- a/magick/profile.c	Sun Jul 18 14:35:54 2021 -0500
+++ b/magick/profile.c	Wed Jul 21 17:45:58 2021 -0500
@@ -1258,7 +1258,7 @@
       (void) LogMagickEvent(TransformEvent,GetMagickModule(),
                             "Adding %s profile with length %ld bytes",name,
                             (unsigned long) length);
-      if (profile != 0)
+      if ((profile != 0) && (length != 0))
         {
           status &= MagickMapAddEntry(image->profiles,name,profile,length,
                                       &image->exception);
diff -r 59c8ee0db7b9 -r 7fd8cd0b7b07 magick/version.h
--- a/magick/version.h	Sun Jul 18 14:35:54 2021 -0500
+++ b/magick/version.h	Wed Jul 21 17:45:58 2021 -0500
@@ -38,8 +38,8 @@
 #define MagickLibVersion  0x252200
 #define MagickLibVersionText  "1.4"
 #define MagickLibVersionNumber 25,22,0
-#define MagickChangeDate   "20210718"
-#define MagickReleaseDate  "snapshot-20210718"
+#define MagickChangeDate   "20210721"
+#define MagickReleaseDate  "snapshot-20210721"
 
 /*
   The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines
diff -r 59c8ee0db7b9 -r 7fd8cd0b7b07 www/Changelog.html
--- a/www/Changelog.html	Sun Jul 18 14:35:54 2021 -0500
+++ b/www/Changelog.html	Wed Jul 21 17:45:58 2021 -0500
@@ -35,6 +35,15 @@
 <div class="document">
 
 
+<p>2021-07-21  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>
+<p>* magick/profile.c (SetImageProfile): Do not try to store a
+zero-sized profile.</p>
+<p>* coders/webp.c (ReadWEBPImage): Enforce that embedded profiles
+provided by libWebP are not zero-sized. This problem was brought
+to our attention by Shane Bishop on the graphicsmagick-help
+mailing list.</p>
+</blockquote>
 <p>2021-07-18  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>
 <p>* Makefile.am: Add support for using an external
diff -r 59c8ee0db7b9 -r 7fd8cd0b7b07 www/api/profile.html
--- a/www/api/profile.html	Sun Jul 18 14:35:54 2021 -0500
+++ b/www/api/profile.html	Wed Jul 21 17:45:58 2021 -0500
@@ -3,7 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.16: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.13.1: http://docutils.sourceforge.net/" />
 <title>profile</title>
 <link rel="stylesheet" href="../docutils-api.css" type="text/css" />
 </head>
@@ -37,7 +37,7 @@
 <h2 class="subtitle" id="manipulate-embedded-profiles">Manipulate embedded profiles</h2>
 
 <div class="contents topic" id="contents">
-<p class="topic-title">Contents</p>
+<p class="topic-title first">Contents</p>
 <ul class="simple">
 <li><a class="reference internal" href="#allocateimageprofileiterator" id="id15">AllocateImageProfileIterator</a></li>
 <li><a class="reference internal" href="#appendimageprofile" id="id16">AppendImageProfile</a></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.