freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master afd1cb2: * src/sfnt/ttload.c (tt_face_load_name): Acc


From: Werner Lemberg
Subject: [freetype2] master afd1cb2: * src/sfnt/ttload.c (tt_face_load_name): Accounting fix.
Date: Sat, 16 Oct 2021 20:31:38 -0400 (EDT)

branch: master
commit afd1cb2881a2da28edd5beb6afcf99121c6ede84
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/sfnt/ttload.c (tt_face_load_name): Accounting fix.
    
    Fallout reported as
      https://crbug.com/40024
---
 src/sfnt/ttload.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index d9d3731..5c00b09 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -956,6 +956,7 @@
     {
       TT_Name  entry = table->names;
       FT_UInt  count = table->numNameRecords;
+      FT_UInt  valid = 0;
 
 
       for ( ; count > 0; count-- )
@@ -991,15 +992,15 @@
         /* mark the string as not yet converted */
         entry->string = NULL;
 
+        valid++;
         entry++;
       }
 
       /* reduce array size to the actually used elements */
-      count = (FT_UInt)( entry - table->names );
       FT_MEM_QRENEW_ARRAY( table->names,
                            table->numNameRecords,
-                           count );
-      table->numNameRecords = count;
+                           valid );
+      table->numNameRecords = valid;
     }
 
     FT_FRAME_EXIT();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]