Skip to content

Commit

Permalink
add guards for h->otl == NULL before calling otlSubtableAdd
Browse files Browse the repository at this point in the history
Testing in macOS 13.x revealed that there was no check for h->otl == NULL before calling otlSubtableAdd, which accesses h->otl in GPOSFill and GSUBFill routines. Without this check, otlSubtableAdd would fail with a segfault when h->otl was passed in NULL.
  • Loading branch information
josh-hadley committed Sep 29, 2023
1 parent 6bbd056 commit fca1212
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions c/makeotf/lib/hotconv/GPOS.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ int GPOSFill(hotCtx g) {

createAnonLookups(g, h);

if (h->otl == NULL) {
return 0;
}

/* Add OTL features */
/* See GSUB.c::GSUBFill() for an explanation of the subtable order */

Expand Down
4 changes: 4 additions & 0 deletions c/makeotf/lib/hotconv/GSUB.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ int GSUBFill(hotCtx g) {

createAnonLookups(g, h);

if (h->otl == NULL) {
return 0;
}

/* Add OTL features */

/* The font tables are in the order:
Expand Down

0 comments on commit fca1212

Please sign in to comment.