mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 00:32:59 +00:00
[directwrite] Handle failures in new API
Still crashes...
This commit is contained in:
parent
f6744c2c73
commit
00360049e3
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue