shithub: freetype+ttf2subf

Download patch

ref: 9b0179597e100e85d543b4e346490ed7b2bb2fff
parent: 07c8d8bbdb0489de06f4d019a2872f4e372e1d73
author: Ben Wagner <[email protected]>
date: Sat Nov 23 05:07:48 EST 2019

[sfnt] Ensure OTTO fonts have tables (#57285).

* src/sfnt/ttload.c (tt_face_load_font_dir): Add test.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-23  Ben Wagner  <[email protected]>
+
+	[sfnt] Ensure OTTO fonts have tables (#57285).
+
+	* src/sfnt/ttload.c (tt_face_load_font_dir): Add test.
+
 2019-11-23  Behdad Esfahbod  <[email protected]>
 
 	Minor fixes for recent compilers.
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -397,7 +397,15 @@
       }
     }
     else
+    {
       valid_entries = sfnt.num_tables;
+      if ( !valid_entries )
+      {
+        FT_TRACE2(( "tt_face_load_font_dir: no valid tables found\n" ));
+        error = FT_THROW( Unknown_File_Format );
+        goto Exit;
+      }
+    }
 
     face->num_tables = valid_entries;
     face->format_tag = sfnt.format_tag;