Added null size test in PixelsPerEm functions
diff --git a/src/FTSize.cpp b/src/FTSize.cpp
index 7bc9a6a..5fb8ffb 100755
--- a/src/FTSize.cpp
+++ b/src/FTSize.cpp
@@ -95,11 +95,11 @@ float FTSize::Underline() const
unsigned int FTSize::XPixelsPerEm() const
{
- return ftSize->metrics.x_ppem;
+ return ftSize == 0 ? 0 : ftSize->metrics.x_ppem;
}
unsigned int FTSize::YPixelsPerEm() const
{
- return ftSize->metrics.y_ppem;
+ return ftSize == 0 ? 0 : ftSize->metrics.y_ppem;
}