ref: 07bdb6e289c7954e2a533039dc93c1c136099d2d
parent: 9b6b5754b57c12b820e01305eb69b8863a161e5a
author: Werner Lemberg <[email protected]>
date: Fri Dec 14 21:02:23 EST 2012
[bdf] Fix Savannah bug #37906. * src/bdf/bdflib.c (_bdf_parse_glyphs): Use correct array size for checking `glyph_enc'.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2012-12-15 Werner Lemberg <[email protected]>
+ [bdf] Fix Savannah bug #37906.
+
+ * src/bdf/bdflib.c (_bdf_parse_glyphs): Use correct array size for
+ checking `glyph_enc'.
+
+2012-12-15 Werner Lemberg <[email protected]>
+
[bdf] Fix Savannah bug #37905.
* src/bdf/bdflib.c (_bdf_parse_start): Reset `props_size' to zero in
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -1628,8 +1628,9 @@
/* Check that the encoding is in the Unicode range because */
/* otherwise p->have (a bitmap with static size) overflows. */
- if ( p->glyph_enc > 0 &&
- (size_t)p->glyph_enc >= sizeof ( p->have ) * 8 )
+ if ( p->glyph_enc > 0 &&
+ (size_t)p->glyph_enc >= sizeof ( p->have ) /
+ sizeof ( unsigned long ) * 32 )
{
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "ENCODING" ));
error = BDF_Err_Invalid_File_Format;