[directwrite] Handle failures in new API

Still crashes...
This commit is contained in:
Behdad Esfahbod 2025-03-13 16:22:45 -06:00
parent f6744c2c73
commit 00360049e3

View file

@ -903,7 +903,15 @@ hb_directwrite_face_create_from_blob_or_fail (hb_blob_t *blob,
unsigned int index)
{
hb_directwrite_face_data_t *data = _hb_directwrite_face_data_create (blob, index);
if (unlikely (!data))
return nullptr;
hb_face_t *face = hb_directwrite_face_create (data->fontFace);
if (unlikely (hb_object_is_immutable (face)))
{
_hb_directwrite_shaper_face_data_destroy (data);
return face;
}
/* Let there be dragons here... */
face->data.directwrite.cmpexch (nullptr, data);