ref: e477744371b17cb5cebe277a94a1b3c599173ffe
parent: 799342c46e5f2928d77701e1b2f787ed729a1cce
author: Ali Gholami Rudi <ali@rudi.ir>
date: Tue Jul 26 17:41:15 EDT 2022
otf: check feature names for discarding duplicate lookups Reported and tested by Dirk-Wilhelm Peters <peters@schwertfisch.de>.
--- a/otf.c
+++ b/otf.c
@@ -843,18 +843,20 @@
{
void *feats = gtab + U16(gtab, 6);
void *feat = feats + U16(featrec, 4);
+ char ftag[8] = "";
int n = U16(feat, 2);
int i, j;
+ memcpy(ftag, featrec, 4);
for (i = 0; i < n; i++) {
int lookup = U16(feat, 4 + 2 * i); /* lookup index */
/* do not store features common to all languages in a script */
for (j = 0; j < lookups_n; j++)
if (lookups[j].lookup == lookup && !lookups[j].lang[0])
- if (!strcmp(lookups[j].scrp, stag))
+ if (!strcmp(lookups[j].scrp, stag) &&
+ !strcmp(lookups[j].feat, ftag))
break;
if (j == lookups_n) {
- memcpy(lookups[j].feat, featrec, 4);
- lookups[j].feat[4] = '\0';
+ strcpy(lookups[j].feat, ftag);
strcpy(lookups[j].scrp, stag);
strcpy(lookups[j].lang, ltag);
lookups[j].lookup = U16(feat, 4 + 2 * i);