From 8a2b444db1d3e65f979db79cb7fda1bc97488ee5 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sun, 4 Mar 2012 08:35:03 +0100 Subject: [PATCH] Revert "[cff] One more check against malformed font matrix." As Alexei points out, this test is completely nonsense. This reverts commit 35bb214ae620400cd09a2cfaf3bacd66e179a1f6. --- ChangeLog | 7 ------- src/cff/cffparse.c | 31 ++++++++++++------------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f727d3b9..f5840ca3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,3 @@ -2012-03-03 Werner Lemberg - - [cff] One more check against malformed font matrix. - - * src/cff/cffparse.c (cff_parse_font_matrix): Guard against `xx' and - `yy' matrix coefficients being zero. - 2012-03-03 Werner Lemberg Fix Savannah bug #35660. diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c index 0873379c9..61fa87c80 100644 --- a/src/cff/cffparse.c +++ b/src/cff/cffparse.c @@ -474,11 +474,22 @@ if ( scaling < 0 || scaling > 9 ) { + /* Return default matrix in case of unlikely values. */ + FT_TRACE1(( "cff_parse_font_matrix:" " strange scaling value for xx element (%d),\n" " " " using default matrix\n", scaling )); - goto Default_matrix; + + matrix->xx = 0x10000L; + matrix->yx = 0; + matrix->xy = 0; + matrix->yy = 0x10000L; + offset->x = 0; + offset->y = 0; + *upm = 1; + + goto Exit; } matrix->yx = cff_parse_fixed_scaled( data++, scaling ); @@ -487,13 +498,6 @@ offset->x = cff_parse_fixed_scaled( data++, scaling ); offset->y = cff_parse_fixed_scaled( data, scaling ); - if ( matrix->xx == 0 || matrix->yy == 0 ) - { - FT_TRACE1(( "cff_parse_font_matrix:" - " xx or yy element is zero, using default matrix\n" )); - goto Default_matrix; - } - *upm = power_tens[scaling]; FT_TRACE4(( " [%f %f %f %f %f %f]\n", @@ -505,17 +509,6 @@ (double)offset->y / *upm / 65536 )); } - goto Exit; - - Default_matrix: - matrix->xx = 0x10000L; - matrix->yx = 0; - matrix->xy = 0; - matrix->yy = 0x10000L; - offset->x = 0; - offset->y = 0; - *upm = 1; - Exit: return error; }