# HG changeset patch # User Matti Hamalainen # Date 1530329517 -10800 # Node ID 868e39741d269f5cd179db269228ae99a20cad73 # Parent 8a98d15174600e5c33a701105ee77699334ca4b4 Only check glyphs that will be saved. diff -r 8a98d1517460 -r 868e39741d26 tools/fontconv.c --- a/tools/fontconv.c Sat Jun 30 06:26:51 2018 +0300 +++ b/tools/fontconv.c Sat Jun 30 06:31:57 2018 +0300 @@ -401,22 +401,23 @@ { DMBitmapGlyph *glyph = &font->glyphMap[n]; - if (glyph->width < DMFONT_MIN_WIDTH || - glyph->height < DMFONT_MIN_HEIGHT || - glyph->width > DMFONT_MAX_WIDTH || - glyph->height > DMFONT_MAX_HEIGHT || - glyph->width > font->width || - glyph->height > font->height) + if (glyph->index >= 0) { - dmErrorMsg("Invalid glyph #%d: %d x %d (font %d x %d)\n", - n, - glyph->width, glyph->height, - font->width, font->height); - goto out; + font->nglyphs++; + if (glyph->width < DMFONT_MIN_WIDTH || + glyph->height < DMFONT_MIN_HEIGHT || + glyph->width > DMFONT_MAX_WIDTH || + glyph->height > DMFONT_MAX_HEIGHT || + glyph->width > font->width || + glyph->height > font->height) + { + dmErrorMsg("Invalid glyph #%d: %d x %d (font %d x %d)\n", + n, + glyph->width, glyph->height, + font->width, font->height); + goto out; + } } - - if (glyph->index >= 0) - font->nglyphs++; } dmMsg(1, "Outputting a DMFONT format bitmap font, %d x %d with %d glyphs (%d max), %d bpp.\n",