summaryrefslogtreecommitdiff
path: root/src/type42
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2018-06-24 06:22:48 +0200
committerWerner Lemberg <wl@gnu.org>2018-06-24 06:26:09 +0200
commitcc3333902bbfe5d8c16cf84c4e85016533ab2ee0 (patch)
tree2917e1d3116623cfd633cbedc2e8990e9355d7bc /src/type42
parentd7393e22ee3d7cfedbf580a7fb1e9b4db7b3626f (diff)
downloadfreetype2-cc3333902bbfe5d8c16cf84c4e85016533ab2ee0.tar.gz
New base function `FT_Matrix_Check' (#54019).
* src/base/ftcalc.c (FT_Matrix_Check): New base function to properly reject degenerate font matrices. * include/freetype/internal/ftcalc.h: Updated. * src/cff/cffparse.c (cff_parse_font_matrix), src/cid/cidload.c (cid_parse_font_matrix), src/type1/t1load.c (t1_parse_font_matrix), src/type42/t42parse.c (t42_parse_font_matrix): Use `FT_Matrix_Check'.
Diffstat (limited to 'src/type42')
-rw-r--r--src/type42/t42parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 009121fc8..edd27a850 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -284,6 +284,13 @@
matrix->xy = temp[2];
matrix->yy = temp[3];
+ if ( !FT_Matrix_Check( matrix ) )
+ {
+ FT_ERROR(( "t42_parse_font_matrix: invalid font matrix\n" ));
+ parser->root.error = FT_THROW( Invalid_File_Format );
+ return;
+ }
+
/* note that the offsets must be expressed in integer font units */
offset->x = temp[4] >> 16;
offset->y = temp[5] >> 16;