Without this certain files may cause ASAN complaints. Also the check
is off by one, so now warn if the index is the same as the count.
const uint8_t *data;
uint16_t flags;
- if (ttf->gid_renum[i] != 0)
- return;
-
- if (i > ttf->orig_num_glyphs)
+ if (i >= ttf->orig_num_glyphs)
{
- fz_warn(ctx, "TTF subsetting; gid > num_gids!");
+ fz_warn(ctx, "TTF subsetting; gid >= num_gids!");
return;
}
+ if (ttf->gid_renum[i] != 0)
+ return;
+
ttf->gid_renum[i] = 1;
/* If this glyf is composite, then we need to add any dependencies of it. */