[bdf] Add missing overflow check.

* src/bdf/bdflib.c (_bdf_parse_glyphs) <BITMAP>: Add threshold for
`glyph->bpr'.
This commit is contained in:
Werner Lemberg 2012-03-08 20:11:37 +01:00
parent 26dfeb6d63
commit c4cad30ed1
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2012-03-08 Werner Lemberg <wl@gnu.org>
[bdf] Add missing overflow check.
* src/bdf/bdflib.c (_bdf_parse_glyphs) <BITMAP>: Add threshold for
`glyph->bpr'.
2012-03-07 Vinnie Falco <vinnie.falco@gmail.com>
Prepare source code for amalgamation.

View File

@ -1912,7 +1912,7 @@
glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;
bitmap_size = glyph->bpr * glyph->bbx.height;
if ( bitmap_size > 0xFFFFU )
if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU )
{
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno ));
error = BDF_Err_Bbx_Too_Big;