GraphicsMagick: WritePICTImage(): Fix use of MagickFreeResourceL...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.1800.1678554231.7850.graphicsmagick-commit@lists.sourceforge.net>
changeset bb77bcdc08b0 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=bb77bcdc08b0
summary: WritePICTImage(): Fix use of MagickFreeResourceLimitedMemory() on non-managed memory.

diffstat:

 ChangeLog          |  5 +++++
 coders/pict.c      |  2 +-
 www/Changelog.html |  4 ++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 123d0b9535b0 -r bb77bcdc08b0 ChangeLog
--- a/ChangeLog	Sat Mar 11 10:38:22 2023 -0600
+++ b/ChangeLog	Sat Mar 11 11:03:40 2023 -0600
@@ -1,5 +1,10 @@
 2023-03-11  Bob Friesenhahn  <[email protected]>
 
+	* coders/pict.c (WritePICTImage): Fix use of
+	MagickFreeResourceLimitedMemory() on non-managed memory. Addresses
+	SourceForge issue #687 "Heap Overflow in gm
+	(magick/memory.c:728)".
+
 	* magick/command.c (MogrifyImage): Validate that -lat argument is
 	correctly formed, and that width and height are not zero.
 
diff -r 123d0b9535b0 -r bb77bcdc08b0 coders/pict.c
--- a/coders/pict.c	Sat Mar 11 10:38:22 2023 -0600
+++ b/coders/pict.c	Sat Mar 11 11:03:40 2023 -0600
@@ -2414,7 +2414,7 @@
       (void) WriteBlob(image,length,blob);
       if (length & 0x01)
         (void) WriteBlobByte(image,'\0');
-      MagickFreeResourceLimitedMemory(blob);
+      MagickFreeMemory(blob);
     }
   /*
     Write picture opcode, row bytes, and picture bounding box, and version.
diff -r 123d0b9535b0 -r bb77bcdc08b0 www/Changelog.html
--- a/www/Changelog.html	Sat Mar 11 10:38:22 2023 -0600
+++ b/www/Changelog.html	Sat Mar 11 11:03:40 2023 -0600
@@ -40,6 +40,10 @@
 <p>2023-03-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>
 <ul class="simple">
+<li><p>coders/pict.c (WritePICTImage): Fix use of
+MagickFreeResourceLimitedMemory() on non-managed memory. Addresses
+SourceForge issue #687 &quot;Heap Overflow in gm
+(magick/memory.c:728)&quot;.</p></li>
 <li><p>magick/command.c (MogrifyImage): Validate that -lat argument is
 correctly formed, and that width and height are not zero.</p></li>
 <li><p>magick/effect.c (AdaptiveThresholdImage): Validate that width
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.