shithub: freetype+ttf2subf

Download patch

ref: a126d4c2ef84cbd282bdeaa6c3376eefbcedcdc9
parent: 46333a118f0cb18f86ddda323cec6220809c130e
author: Werner Lemberg <[email protected]>
date: Sat Sep 20 10:25:10 EDT 2003

* src/type1/t1parse.c (pfb_tag_fields): Removed.
(read_pfb_tag): Fix code so that it doesn't fail on end-of-file
indicated (0x8003).

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-19  David Bevan  <[email protected]>
+
+	* src/type1/t1parse.c (pfb_tag_fields): Removed.
+	(read_pfb_tag): Fix code so that it doesn't fail on end-of-file
+	indicated (0x8003).
+
 2003-09-16  Werner Lemberg  <[email protected]>
 
 	* include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 parser (body).                                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -79,20 +79,6 @@
   } PFB_Tag;
 
 
-#undef  FT_STRUCTURE
-#define FT_STRUCTURE  PFB_Tag
-
-
-  static
-  const FT_Frame_Field  pfb_tag_fields[] =
-  {
-    FT_FRAME_START( 6 ),
-      FT_FRAME_USHORT ( tag ),
-      FT_FRAME_LONG_LE( size ),
-    FT_FRAME_END
-  };
-
-
   static FT_Error
   read_pfb_tag( FT_Stream   stream,
                 FT_UShort*  tag,
@@ -104,14 +90,18 @@
 
     *tag  = 0;
     *size = 0;
-    if ( !FT_STREAM_READ_FIELDS( pfb_tag_fields, &head ) )
+
+    if ( !FT_READ_USHORT( head.tag ) )
     {
       if ( head.tag == 0x8001U || head.tag == 0x8002U )
       {
-        *tag  = head.tag;
-        *size = head.size;
+        if ( !FT_READ_LONG_LE( head.size ) )
+          *size = head.size;
       }
+
+      *tag = head.tag;
     }
+
     return error;
   }