diff options
author | Werner Lemberg <wl@gnu.org> | 2018-06-24 06:22:48 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2018-06-24 06:26:09 +0200 |
commit | cc3333902bbfe5d8c16cf84c4e85016533ab2ee0 (patch) | |
tree | 2917e1d3116623cfd633cbedc2e8990e9355d7bc /src/cid/cidload.c | |
parent | d7393e22ee3d7cfedbf580a7fb1e9b4db7b3626f (diff) | |
download | freetype2-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/cid/cidload.c')
-rw-r--r-- | src/cid/cidload.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cid/cidload.c b/src/cid/cidload.c index dc458e8fd..8f2a312ab 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -200,6 +200,13 @@ matrix->xy = temp[2]; matrix->yy = temp[3]; + if ( !FT_Matrix_Check( matrix ) ) + { + FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" )); + parser->root.error = FT_THROW( Invalid_File_Format ); + return FT_THROW( Invalid_File_Format ); + } + /* note that the font offsets are expressed in integer font units */ offset->x = temp[4] >> 16; offset->y = temp[5] >> 16; |