GraphicsMagick: PICT: Assure that the claimed scanline length is...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.1836.1641942041.2413.graphicsmagick-commit@lists.sourceforge.net>
changeset 241c653c42ad in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=241c653c42ad
summary: PICT: Assure that the claimed scanline length is within the bounds of the scanline allocation

diffstat:

 ChangeLog                              |   6 ++++++
 VisualMagick/installer/inc/version.isx |   4 ++--
 coders/pict.c                          |  11 +++++++++++
 magick/version.h                       |   4 ++--
 www/Changelog.html                     |   5 +++++
 www/index.html                         |   4 ++--
 www/index.rst                          |   4 ++--
 7 files changed, 30 insertions(+), 8 deletions(-)

diffs (102 lines):

diff -r 9b6b6e12b91d -r 241c653c42ad ChangeLog
--- a/ChangeLog	Sun Jan 09 10:14:13 2022 -0600
+++ b/ChangeLog	Tue Jan 11 17:00:24 2022 -0600
@@ -1,3 +1,9 @@
+2022-01-11  Bob Friesenhahn  <[email protected]>
+
+        * coders/pict.c (DecodeImage): Assure that the claimed scanline
+        length is within the bounds of the scanline allocation to avoid
+        possible heap overflow.
+
 2022-01-09  Bob Friesenhahn  <[email protected]>
 
         * magick/blob.c: Make sure that read resource limiting can support
diff -r 9b6b6e12b91d -r 241c653c42ad VisualMagick/installer/inc/version.isx
--- a/VisualMagick/installer/inc/version.isx	Sun Jan 09 10:14:13 2022 -0600
+++ b/VisualMagick/installer/inc/version.isx	Tue Jan 11 17:00:24 2022 -0600
@@ -10,5 +10,5 @@
 
 #define public MagickPackageName "GraphicsMagick"
 #define public MagickPackageVersion "1.4"
-#define public MagickPackageVersionAddendum ".020220109"
-#define public MagickPackageReleaseDate "snapshot-20220109"
+#define public MagickPackageVersionAddendum ".020220111"
+#define public MagickPackageReleaseDate "snapshot-20220111"
diff -r 9b6b6e12b91d -r 241c653c42ad coders/pict.c
--- a/coders/pict.c	Sun Jan 09 10:14:13 2022 -0600
+++ b/coders/pict.c	Tue Jan 11 17:00:24 2022 -0600
@@ -942,6 +942,17 @@
                               scanline_length, (MAGICK_SIZE_T)scanline_alloc);
       if (scanline_length < 2)
         {
+          (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                                "Scanline length %u < 2!",scanline_length);
+          ThrowException(&image->exception,CorruptImageError,UnableToUncompressImage,
+                         image->filename);
+          goto decode_error_exit;
+        }
+      if (scanline_length > scanline_alloc)
+        {
+          (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                                "Scanline length %u exceeds allocation %"MAGICK_SIZE_T_F"u",
+                                scanline_length, (MAGICK_SIZE_T)scanline_alloc);
           ThrowException(&image->exception,CorruptImageError,UnableToUncompressImage,
                          image->filename);
           goto decode_error_exit;
diff -r 9b6b6e12b91d -r 241c653c42ad magick/version.h
--- a/magick/version.h	Sun Jan 09 10:14:13 2022 -0600
+++ b/magick/version.h	Tue Jan 11 17:00:24 2022 -0600
@@ -38,8 +38,8 @@
 #define MagickLibVersion  0x262300
 #define MagickLibVersionText  "1.4"
 #define MagickLibVersionNumber 26,23,0
-#define MagickChangeDate   "20220109"
-#define MagickReleaseDate  "snapshot-20220109"
+#define MagickChangeDate   "20220111"
+#define MagickReleaseDate  "snapshot-20220111"
 
 /*
   The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines
diff -r 9b6b6e12b91d -r 241c653c42ad www/Changelog.html
--- a/www/Changelog.html	Sun Jan 09 10:14:13 2022 -0600
+++ b/www/Changelog.html	Tue Jan 11 17:00:24 2022 -0600
@@ -35,6 +35,11 @@
 <div class="document">
 
 
+<p>2022-01-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>
+<blockquote>
+* coders/pict.c (DecodeImage): Assure that the claimed scanline
+length is within the bounds of the scanline allocation to avoid
+possible heap overflow.</blockquote>
 <p>2022-01-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>
 * magick/blob.c: Make sure that read resource limiting can support
diff -r 9b6b6e12b91d -r 241c653c42ad www/index.html
--- a/www/index.html	Sun Jan 09 10:14:13 2022 -0600
+++ b/www/index.html	Tue Jan 11 17:00:24 2022 -0600
@@ -61,8 +61,8 @@
 <a class="reference external" href="https://graphicsmagick.sourceforge.io/index.html">https://graphicsmagick.sourceforge.io/index.html</a> for the latest
 version of this page.</p>
 <p>GraphicsMagick is the swiss army knife of image processing. Comprised
-of 267K physical lines (according to David A. Wheeler's <a class="reference external" href="https://dwheeler.com/sloccount/">SLOCCount</a>)
-of source code in the base package (or 1,225K including 3rd party
+of 279K physical lines (according to David A. Wheeler's <a class="reference external" href="https://dwheeler.com/sloccount/">SLOCCount</a>)
+of source code in the base package (or 1,275K including 3rd party
 libraries) it provides a robust and efficient collection of tools and
 libraries which support reading, writing, and manipulating an image in
 over 89 major formats including important formats like DPX, GIF, JPEG,
diff -r 9b6b6e12b91d -r 241c653c42ad www/index.rst
--- a/www/index.rst	Sun Jan 09 10:14:13 2022 -0600
+++ b/www/index.rst	Tue Jan 11 17:00:24 2022 -0600
@@ -66,8 +66,8 @@
 .. _`oss-fuzz` : https://github.com/google/oss-fuzz
 
 GraphicsMagick is the swiss army knife of image processing. Comprised
-of 267K physical lines (according to David A. Wheeler's `SLOCCount`_)
-of source code in the base package (or 1,225K including 3rd party
+of 279K physical lines (according to David A. Wheeler's `SLOCCount`_)
+of source code in the base package (or 1,275K including 3rd party
 libraries) it provides a robust and efficient collection of tools and
 libraries which support reading, writing, and manipulating an image in
 over 89 major formats including important formats like DPX, GIF, JPEG,
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.