Fixed possible crash in sf::Font

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1364 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-01-19 22:19:29 +00:00
parent 2e40f341ba
commit b6b423bd8f

View File

@ -179,6 +179,10 @@ const Glyph& Font::GetGlyph(Uint32 codePoint, unsigned int characterSize, bool b
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int Font::GetKerning(Uint32 first, Uint32 second, unsigned int characterSize) const int Font::GetKerning(Uint32 first, Uint32 second, unsigned int characterSize) const
{ {
// Special case where first or second is 0 (null character)
if (first == 0 || second == 0)
return 0;
FT_Face face = static_cast<FT_Face>(myFace); FT_Face face = static_cast<FT_Face>(myFace);
if (face && FT_HAS_KERNING(face) && SetCurrentSize(characterSize)) if (face && FT_HAS_KERNING(face) && SetCurrentSize(characterSize))