Commit cff026d41599945498044d2f4dcc0e610ffb6929

Alexei Podtelezhnikov 2021-11-23T16:05:12

[truetype] Partly revert 5b626281. Fixes #1118. * src/truetype/ttpload.c (tt_face_load_hdmx): Do not assume that `record_size` is rounded even though the records are padded.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c
index 1368e17..55a2238 100644
--- a/src/truetype/ttpload.c
+++ b/src/truetype/ttpload.c
@@ -565,7 +565,7 @@
     if ( num_records > 255               ||
          ( num_records > 0             &&
            ( record_size > 0x10004UL ||
-             record_size & 3         ) ) )
+             record_size < 4         ) ) )
     {
       error = FT_THROW( Invalid_File_Format );
       goto Fail;