shithub: freetype+ttf2subf

Download patch

ref: 4dbf00aa237916df9fbfe4624dad102648096078
parent: a4cb0d95d90a7ed76625dc5d60af66dca03733c5
author: Werner Lemberg <[email protected]>
date: Thu Aug 28 12:12:48 EDT 2008

* src/type1/t1load.c (parse_encoding): Protect against infinite
loop.  This fixes Savannah bug #24150 (where a patch has been posted
too).

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-28  Werner Lemberg  <[email protected]>
+
+	* src/type1/t1load.c (parse_encoding): Protect against infinite
+	loop.  This fixes Savannah bug #24150 (where a patch has been posted
+	too).
+
 2008-08-23  Werner Lemberg  <[email protected]>
 
 	* src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1274,6 +1274,19 @@
 
             n++;
           }
+          else if ( only_immediates )
+          {
+            /* Since the current position is not updated for           */
+            /* immediates-only mode we would get an infinite loop if   */
+            /* we don't do anything here.                              */
+            /*                                                         */
+            /* This encoding array is not valid according to the type1 */
+            /* specification (it might be an encoding for a CID type1  */
+            /* font, however), so we conclude that this font is NOT a  */
+            /* type1 font.                                             */
+            parser->root.error = FT_Err_Unknown_File_Format;
+            return;
+          }
         }
         else
         {