check array index range

This commit is contained in:
uobikiemukot 2015-07-29 15:38:26 +09:00
parent 59bcf3e7c0
commit abb87048c5

View file

@ -141,6 +141,9 @@ int read_bitmap(struct glyph_list_t **glist_head, struct glyph_t *default_glyph,
shift_glyph(bdf_header, bdf_char);
if (bdf_char->encoding < 0 || bdf_char->encoding >= UCS2_CHARS)
return BDF_CHAR;
code = convert_table[bdf_char->encoding];
width = bdf_char->dwidth;
height = bdf_header->ascent + bdf_header->descent;