[base] Check if the returned base_coord is valid
This commit is contained in:
parent
53853c044a
commit
d9c44e7239
|
@ -116,6 +116,8 @@ struct BaseCoordFormat3
|
||||||
|
|
||||||
struct BaseCoord
|
struct BaseCoord
|
||||||
{
|
{
|
||||||
|
bool has_data () const { return u.format; }
|
||||||
|
|
||||||
hb_position_t get_coord (hb_font_t *font,
|
hb_position_t get_coord (hb_font_t *font,
|
||||||
const VariationStore &var_store,
|
const VariationStore &var_store,
|
||||||
hb_direction_t direction) const
|
hb_direction_t direction) const
|
||||||
|
@ -449,7 +451,8 @@ struct BASE
|
||||||
hb_position_t *base) const
|
hb_position_t *base) const
|
||||||
{
|
{
|
||||||
const BaseCoord *base_coord;
|
const BaseCoord *base_coord;
|
||||||
if (!get_axis (direction).get_baseline (baseline, script_tag, language_tag, &base_coord))
|
if (unlikely (!get_axis (direction).get_baseline (baseline, script_tag, language_tag, &base_coord) &&
|
||||||
|
base_coord && !base_coord->has_data ()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (likely (base && base_coord))
|
if (likely (base && base_coord))
|
||||||
|
|
Loading…
Reference in New Issue