In C it is undefined behavior to do arithmetic on a null pointer, including adding zero. When using NotoSansKhmer[wdth,wght].ttf UBSAN produces a report like ttgxvar.c:1052:31: runtime error: applying zero offset to null pointer when adding zero to `varData->deltaSet` (which is null) to produce `bytes`. Protect against all the potential issues of this kind by returning early if `varData->regionIdxCount == 0`. * src/truetype/ttgxvar.c (tt_var_get_item_delta): early return on no regionsadjust
parent
2a7bb4596f
commit
b1cbcb2045
1 changed files with 3 additions and 0 deletions
Loading…
Reference in new issue