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

Introdruced in previous change.  Reported by Alexei.
2.6.5
Werner Lemberg 10 years ago
parent f34f192535
commit 3d167cbe7f
  1. 6
      ChangeLog
  2. 23
      src/base/ftobjs.c

@ -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.

@ -3635,7 +3635,8 @@
FT_Pointer buffer,
FT_UInt buffer_max )
{
FT_Error error;
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 );
if ( service && service->get_name )
error = service->get_name( face, glyph_index, buffer, buffer_max );
}
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 );

Loading…
Cancel
Save