Hi,
I found a minor issue in bmFont 1.14 (latest version): when you use the autofitter and the only not fitting character is the invalid glyph the program access the noFit array with a negative index because the invalid glyph has -1 as id.
I've attached a patch fixing this bug
thank you for your great work
V
Index: source/fontgen.cpp
===================================================================
--- source/fontgen.cpp (revision 28)
+++ source/fontgen.cpp (working copy)
@@ -2035,7 +2035,9 @@
for( int n = 0; n < numChars; n++ )
{
- if( ch[n] == 0 )
+ // avoid to access the noFit array with a negative value
+ // (it could appen if the only not fitting character is the invalid glyph)
+ if( ch[n] == 0 || ch[n]->m_id < 0)
continue;
noFit[ch[n]->m_id] = true;
@@ -3145,4 +3147,4 @@
void CFontGen::ClearFailedCharacters()
{
memset(noFit, 0, sizeof(noFit));
-}
\ No newline at end of file
+}