* src/type42/t42parse.c (t42_parse_sfnts): More tracing messages.
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 71 72 73 74 75 76
diff --git a/ChangeLog b/ChangeLog
index f296352..ae007eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2020-11-09 Werner Lemberg <wl@gnu.org>
+
+ * src/type42/t42parse.c (t42_parse_sfnts): More tracing messages.
+
2020-11-04 Werner Lemberg <wl@gnu.org>
* meson.build: Fix .pc file generation.
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 9850769..88877dd 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -576,6 +576,9 @@
old_string_size = 0;
count = 0;
+ FT_TRACE2(( "\n" ));
+ FT_TRACE2(( "t42_parse_sfnts:\n" ));
+
while ( parser->root.cursor < limit )
{
FT_ULong size;
@@ -680,6 +683,9 @@
goto Fail;
}
+ FT_TRACE2(( " PS string size %5lu bytes, offset 0x%08x (%lu)\n",
+ string_size, count, count ));
+
/* The whole TTF is now loaded into `string_buf'. We are */
/* checking its contents while copying it to `ttf_data'. */
@@ -702,6 +708,9 @@
status = BEFORE_TABLE_DIR;
face->ttf_size = 12 + 16 * num_tables;
+ FT_TRACE2(( " SFNT directory contains %d tables\n",
+ num_tables ));
+
if ( (FT_Long)size < face->ttf_size )
{
FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
@@ -727,12 +736,18 @@
FT_ULong len;
+ FT_TRACE2(( "\n" ));
+ FT_TRACE2(( " table length\n" ));
+ FT_TRACE2(( " ------------------------------\n" ));
+
for ( i = 0; i < num_tables; i++ )
{
FT_Byte* p = face->ttf_data + 12 + 16 * i + 12;
len = FT_PEEK_ULONG( p );
+ FT_TRACE2(( " %4i 0x%08x (%lu)\n", i, len, len ));
+
if ( len > size ||
face->ttf_size > (FT_Long)( size - len ) )
{
@@ -748,6 +763,10 @@
status = OTHER_TABLES;
+ FT_TRACE2(( "\n" ));
+ FT_TRACE2(( " allocating %ld bytes\n", face->ttf_size + 1 ));
+ FT_TRACE2(( "\n" ));
+
if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables,
face->ttf_size + 1 ) )
goto Fail;