[autofit] Remove globals->gsub_length.

We completely validate the accessed data from the 'GSUB' table, making this
field unnecessary.

* src/autofit/afglobal.h (AF_FaceGlobalsRec): Remove `gsub_length` field.

* src/autofit/afglobal.c (af_face_globals_new), src/autofit/afgsub.c
  (af_parse_gsub): Updated.
This commit is contained in:
Werner Lemberg 2025-07-01 22:15:07 +02:00
parent f1cd6dbfa0
commit 0fd0cf33fd
3 changed files with 3 additions and 11 deletions

View file

@ -373,9 +373,7 @@
globals->hb_font = NULL;
globals->hb_buf = NULL;
globals->gsub_length = 0;
globals->gsub = NULL;
globals->gsub = NULL;
globals->gsub_lookups_single_alternate = NULL;
}
#endif

View file

@ -115,9 +115,7 @@ FT_BEGIN_HEADER
hb_buffer_t* hb_buf; /* for feature comparison */
/* The GSUB table. */
FT_ULong gsub_length;
FT_Byte* gsub;
/* Lookup offsets, with only SingleSubst and AlternateSubst non-NULL. */
FT_UInt32* gsub_lookups_single_alternate;
#endif

View file

@ -310,9 +310,7 @@
FT_Byte* limit;
globals->gsub_length = 0;
globals->gsub = NULL;
globals->gsub = NULL;
globals->gsub_lookups_single_alternate = NULL;
/* No error if we can't load or parse GSUB data. */
@ -364,9 +362,7 @@
idx++;
}
globals->gsub_length = gsub_length;
globals->gsub = gsub;
globals->gsub = gsub;
globals->gsub_lookups_single_alternate = gsub_lookups_single_alternate;
return;