shithub: freetype+ttf2subf

Download patch

ref: ddf38726996d2293ea11f6f322ae5abb9049fbed
parent: 9c45ac39661af69119e95d25e4d4dc09c6467d43
author: Werner Lemberg <[email protected]>
date: Thu Oct 27 03:27:27 EDT 2016

[truetype] Fix commit from 2014-11-24.

Problem reported by Hin-Tak Leung  <[email protected]>.

* src/truetype/ttpload.c (tt_face_load_hdmx): Fix file checking
logic.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-10-27  Werner Lemberg  <[email protected]>
+
+	[truetype] Fix commit from 2014-11-24.
+
+	Problem reported by Hin-Tak Leung  <[email protected]>.
+
+	* src/truetype/ttpload.c (tt_face_load_hdmx): Fix file checking
+	logic.
+
 2016-10-26  Werner Lemberg  <[email protected]>
 
 	Add `FT_Get_{MM,Var}_Blend_Coordinates' functions.
--- a/src/truetype/ttpload.c
+++ b/src/truetype/ttpload.c
@@ -563,10 +563,11 @@
       record_size &= 0xFFFFU;
 
     /* The limit for `num_records' is a heuristic value. */
-    if ( version != 0           ||
-         num_records > 255      ||
-         record_size > 0x10001L ||
-         record_size < 4        )
+    if ( version != 0                   ||
+         num_records > 255              ||
+         ( num_records > 0            &&
+           ( record_size > 0x10001L ||
+             record_size < 4        ) ) )
     {
       error = FT_THROW( Invalid_File_Format );
       goto Fail;