diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-12-03 04:03:12 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-12-03 04:03:12 +0000 |
commit | 4ee9d04bd5d518e5f1f86875f4f8184fc0552f44 (patch) | |
tree | 4f27c2cc7196ba469bf631ffe0460cb3d6bcbc9d /Build/source/libs/freetype2/freetype-src/src/winfonts | |
parent | 39bd39ea6f91fb51d118264f372905de9accc347 (diff) |
freetype 2.11.1
git-svn-id: svn://tug.org/texlive/trunk@61211 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/winfonts')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c b/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c index d590c0a22b8..b4fabad2837 100644 --- a/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c +++ b/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c @@ -217,7 +217,11 @@ /* first of all, read the FNT header */ if ( FT_STREAM_SEEK( font->offset ) || FT_STREAM_READ_FIELDS( winfnt_header_fields, header ) ) + { + FT_TRACE2(( " not a Windows FNT file\n" )); + error = FT_THROW( Unknown_File_Format ); goto Exit; + } /* check header */ if ( header->version != 0x200 && @@ -284,7 +288,10 @@ /* does it begin with an MZ header? */ if ( FT_STREAM_SEEK( 0 ) || FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) ) + { + error = FT_ERR( Unknown_File_Format ); goto Exit; + } error = FT_ERR( Unknown_File_Format ); if ( mz_header.magic == WINFNT_MZ_MAGIC ) @@ -885,7 +892,7 @@ } family_size = font->header.file_size - font->header.face_name_offset; /* Some broken fonts don't delimit the face name with a final */ - /* NULL byte -- the frame is erroneously one byte too small. */ + /* null byte -- the frame is erroneously one byte too small. */ /* We thus allocate one more byte, setting it explicitly to */ /* zero. */ if ( FT_QALLOC( font->family_name, family_size + 1 ) ) @@ -897,9 +904,10 @@ font->family_name[family_size] = '\0'; - if ( FT_REALLOC( font->family_name, - family_size, - ft_strlen( font->family_name ) + 1 ) ) + /* shrink it to the actual length */ + if ( FT_QREALLOC( font->family_name, + family_size + 1, + ft_strlen( font->family_name ) + 1 ) ) goto Fail; root->family_name = font->family_name; |