Index: src/bdf/bdflib.c =================================================================== --- src/bdf/bdflib.c.orig 2007-07-07 01:14:17.000000000 -0700 +++ src/bdf/bdflib.c 2007-07-07 01:14:29.000000000 -0700 @@ -1578,6 +1578,14 @@ goto Exit; } + /* Check that the encoding is in the range [0, 65535] because */ + /* otherwise p->have (a bitmap with static size) overflows. */ + if ( p->glyph_enc >= sizeof(p->have) * 8 ) + { + error = BDF_Err_Invalid_File_Format; /* Not the ideal error code */ + goto Exit; + } + /* Check to see whether this encoding has already been encountered. */ /* If it has then change it to unencoded so it gets added if */ /* indicated. */