* src/truetype/ttgload.c (load_truetype_glyph): fixing crash when dealing

with invalid fonts (i.e. glyph size < 10 bytes)..
This commit is contained in:
David Turner 2001-12-14 15:14:44 +00:00
parent 3b7f20b4ec
commit 24c7b56a57
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2001-12-14 Scott Long <scott@swiftview.com>
* src/truetype/ttgload.c (load_truetype_glyph): fixing crash when dealing
with invalid fonts (i.e. glyph size < 10 bytes)..
2001-12-14 Sam Latinga <slouken@devolution.com>
* builds/mac/freetype.mac: a new Makefile to build with MPW on MacOS

View File

@ -723,6 +723,16 @@
if ( index < (FT_UInt)face->num_locations - 1 )
count = face->glyph_locations[index + 1] - offset;
/* temporary hack */
#if 1
if ( count < 10 )
{
/* This glyph is corrupted -- it does not have a complete header */
error = TT_Err_Invalid_Outline;
goto Fail;
}
#endif
if ( count == 0 )
{
/* as described by Frederic Loyer, these are spaces, and */