* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning.

Introdruced in previous change.  Reported by Alexei.
This commit is contained in:
Werner Lemberg 2014-11-27 05:19:41 +01:00
parent f34f192535
commit 3d167cbe7f
2 changed files with 15 additions and 14 deletions

View File

@ -1,3 +1,9 @@
2014-11-27 Werner Lemberg <wl@gnu.org>
* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning.
Introdruced in previous change. Reported by Alexei.
2014-11-26 Werner Lemberg <wl@gnu.org>
* src/*: Add checks for parameters of API functions where missing.

View File

@ -3636,6 +3636,7 @@
FT_UInt buffer_max )
{
FT_Error error;
FT_Service_GlyphDict service;
if ( !face )
@ -3645,21 +3646,15 @@
return FT_THROW( Invalid_Argument );
/* clean up buffer */
((FT_Byte*)buffer)[0] = 0;
((FT_Byte*)buffer)[0] = '\0';
if ( (FT_Long)glyph_index <= face->num_glyphs &&
FT_HAS_GLYPH_NAMES( face ) )
{
FT_Service_GlyphDict service;
FT_FACE_LOOKUP_SERVICE( face,
service,
GLYPH_DICT );
if ( (FT_Long)glyph_index > face->num_glyphs ||
!FT_HAS_GLYPH_NAMES( face ) )
return FT_THROW( Invalid_Argument );
FT_FACE_LOOKUP_SERVICE( face, service, GLYPH_DICT );
if ( service && service->get_name )
error = service->get_name( face, glyph_index, buffer, buffer_max );
}
else
error = FT_THROW( Invalid_Argument );