Crash in annotate.c and a fix

Peter Boos <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
Index: ChangeLog
===================================================================
RCS file: /GraphicsMagick/GraphicsMagick/ChangeLog,v
retrieving revision 1.854
diff -u -r1.854 ChangeLog
--- ChangeLog	10 Mar 2004 01:10:17 -0000	1.854
+++ ChangeLog	10 Mar 2004 08:14:39 -0000
@@ -1,3 +1,17 @@
+2004-03-10  Peter Boos  <[email protected]>
+
+	I found a crash in annotate.c. It is seldom, but...
+	Calling DrawAnnotation with a string containing only one
+	character and this character is not recognized by the
+	TT engine, a crash occurs.
+	In line 1195, this function call fails:
+		status=FT_Load_Glyph(face,glyph.id,FT_LOAD_DEFAULT);
+	and left the glyph.image undefined, which produces a crash in
+	line 1317:
+		    FT_Done_Glyph(glyph.image);
+	Because glyph.image is never set to a valid pointer.
+	Now fixed.
+
 2004-03-09  Bob Friesenhahn  <[email protected]>
 
 	* magick/image.c (QuantumOperatorRegionImage): Properly handle
Index: magick/annotate.c
===================================================================
RCS file: /GraphicsMagick/GraphicsMagick/magick/annotate.c,v
retrieving revision 1.420
diff -u -r1.420 annotate.c
--- magick/annotate.c	29 Dec 2003 03:03:57 -0000	1.420
+++ magick/annotate.c	10 Mar 2004 08:15:06 -0000
@@ -1191,6 +1191,7 @@
         origin.x+=kerning.x;
       }
     glyph.origin=origin;
+    glyph.image=0;
     status=FT_Load_Glyph(face,glyph.id,FT_LOAD_DEFAULT);
     if (status != False)
       continue;



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
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.