Commit f1e6cfd8575ea47ef1584eb181d2e8ceba90bf04

henry 2003-05-04T21:06:27

Added null size test in PixelsPerEm functions

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
 }