forked from minhngoc25a/freetype2
Improve handling of invalid glyph indices in char->index functions.
* src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a loop.
This commit is contained in:
parent
10cf388795
commit
2415cbf365
|
@ -1,3 +1,10 @@
|
||||||
|
2010-02-26 Behdad Esfahbod <behdad@behdad.org>
|
||||||
|
|
||||||
|
Improve handling of invalid glyph indices in char->index functions.
|
||||||
|
|
||||||
|
* src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a
|
||||||
|
loop.
|
||||||
|
|
||||||
2010-02-18 Chris Liddell <chris.liddell@artifex.com>
|
2010-02-18 Chris Liddell <chris.liddell@artifex.com>
|
||||||
|
|
||||||
Fix Savannah bug #28905.
|
Fix Savannah bug #28905.
|
||||||
|
|
|
@ -3095,7 +3095,7 @@
|
||||||
}
|
}
|
||||||
result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode );
|
result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode );
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3112,11 +3112,13 @@
|
||||||
if ( face && face->charmap )
|
if ( face && face->charmap )
|
||||||
{
|
{
|
||||||
gindex = FT_Get_Char_Index( face, 0 );
|
gindex = FT_Get_Char_Index( face, 0 );
|
||||||
if ( gindex == 0 )
|
if ( gindex == 0 || gindex >= (FT_UInt)face->num_glyphs )
|
||||||
result = FT_Get_Next_Char( face, 0, &gindex );
|
do {
|
||||||
|
result = FT_Get_Next_Char( face, 0, &gindex );
|
||||||
|
} while ( gindex >= (FT_UInt)face->num_glyphs );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( agindex )
|
if ( agindex )
|
||||||
*agindex = gindex;
|
*agindex = gindex;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -3140,7 +3142,10 @@
|
||||||
FT_CMap cmap = FT_CMAP( face->charmap );
|
FT_CMap cmap = FT_CMAP( face->charmap );
|
||||||
|
|
||||||
|
|
||||||
gindex = cmap->clazz->char_next( cmap, &code );
|
do {
|
||||||
|
gindex = cmap->clazz->char_next( cmap, &code );
|
||||||
|
} while ( gindex >= (FT_UInt)face->num_glyphs );
|
||||||
|
|
||||||
result = ( gindex == 0 ) ? 0 : code;
|
result = ( gindex == 0 ) ? 0 : code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue