* 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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
diff --git a/ChangeLog b/ChangeLog
index 3eccefb..d614995 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-19 David Bevan <dbevan@emtex.com>
+
+ * 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 <wl@gnu.org>
* include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c
index c1783f0..cf12c5a 100644
--- 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;
}