[mac] Fix buffer size calculation for LWFN font. * src/base/ftmac.c (read_lwfn): Cast post_size to FT_ULong to prevent confused copy by too large chunk size.
diff --git a/ChangeLog b/ChangeLog
index 7150091..6d0941e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-09-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ [mac] Fix buffer size calculation for LWFN font.
+
+ * src/base/ftmac.c (read_lwfn): Cast post_size to FT_ULong
+ to prevent confused copy by too large chunk size.
+
2015-09-26 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/smooth/ftgrays.c (PIXEL_MASK): Remove unused macro.
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 8463190..114bbb6 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -618,7 +618,7 @@
total_size += 6; /* code + 4 bytes chunk length */
}
- total_size += GetHandleSize( post_data ) - 2;
+ total_size += (FT_ULong)GetHandleSize( post_data ) - 2;
last_code = code;
/* detect resource fork overflow */