Access font after the null check in sceFontGetCharImageRect, not before.

This commit is contained in:
Lioncash committed 2013-12-27 11:42:14 -05:00
1 parent 7a643f3c78
commit 19dee283f2
1 file changed
+2 -2
+2 -2
View File
@@ -848,9 +848,9 @@ int sceFontGetCharImageRect(u32 fontHandle, u32 charCode, u32 charRectPtr) {
PGFCharInfo charInfo;
LoadedFont *font = GetLoadedFont(fontHandle, false);
auto fontLib = font->GetFontLib();
int altCharCode = fontLib == NULL ? -1 : fontLib->GetAltCharCode();
if (font) {
auto fontLib = font->GetFontLib();
int altCharCode = fontLib == NULL ? -1 : fontLib->GetAltCharCode();
font->GetPGF()->GetCharInfo(charCode, &charInfo, altCharCode);
Memory::Write_U16(charInfo.bitmapWidth, charRectPtr); // character bitmap width in pixels
Memory::Write_U16(charInfo.bitmapHeight, charRectPtr + 2); // character bitmap height in pixels