diff options
Diffstat (limited to 'src/winfonts/winfnt.c')
-rw-r--r-- | src/winfonts/winfnt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c index 31ae54556..9ee9f6755 100644 --- a/src/winfonts/winfnt.c +++ b/src/winfonts/winfnt.c @@ -267,6 +267,15 @@ goto Exit; } + /* loading `winfnt_header_fields' needs at least 118 bytes; */ + /* use this as a rough measure to check the expected font size */ + if ( font_count * 118UL > stream->size ) + { + FT_TRACE2(( "invalid number of faces\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + face->root.num_faces = font_count; if ( face_index >= font_count ) |