summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/winfonts/winfnt.c16
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;