diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-10-16 20:25:11 -0400 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-10-16 20:25:11 -0400 |
commit | afd1cb2881a2da28edd5beb6afcf99121c6ede84 (patch) | |
tree | 7ad1fbe0d5f77be94449e766f9fb7ad89e0b4e1a /src | |
parent | c71eb22dde1a3101891a865fdac20a6de814267d (diff) | |
download | freetype2-afd1cb2881a2da28edd5beb6afcf99121c6ede84.tar.gz |
* src/sfnt/ttload.c (tt_face_load_name): Accounting fix.
Fallout reported as
https://crbug.com/40024
Diffstat (limited to 'src')
-rw-r--r-- | src/sfnt/ttload.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index d9d373103..5c00b09fd 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(); |