diff --git a/src/hb-font.cc b/src/hb-font.cc index 9f0dcf80d..417420404 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -2458,6 +2458,9 @@ hb_bool_t hb_font_set_funcs_using (hb_font_t *font, const char *name) { + if (unlikely (hb_object_is_immutable (font))) + return false; + bool retry = false; if (!name || !*name) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 15a87c264..387105a52 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -143,6 +143,9 @@ _hb_ft_font_destroy (void *data) /* hb_font changed, update FT_Face. */ static void _hb_ft_hb_font_changed (hb_font_t *font, FT_Face ft_face) { + if (unlikely (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)) + return; + hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data; float x_mult = 1.f, y_mult = 1.f; @@ -1725,7 +1728,12 @@ hb_ft_font_set_funcs (hb_font_t *font) ft_face->generic.finalizer = _release_blob; // And the FT_Library to the blob - hb_blob_set_user_data (blob, &ft_library_key, ft_library, destroy_ft_library, true); + if (unlikely (!hb_blob_set_user_data (blob, &ft_library_key, ft_library, destroy_ft_library, true))) + { + DEBUG_MSG (FT, font, "hb_blob_set_user_data() failed"); + FT_Done_Face (ft_face); + return; + } _hb_ft_font_set_funcs (font, ft_face, true); hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING); diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index d8b116366..509a7863f 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -57,7 +57,7 @@ dependencies = [ [[package]] name = "harfruzz" version = "0.1.0" -source = "git+https://github.com/harfbuzz/harfruzz#702e3bd4dfdaf9ea6b084467deb4c052a8cfa748" +source = "git+https://github.com/harfbuzz/harfruzz#966d38a4b7b2f23b77a0ce4c356542e9395102e8" dependencies = [ "bitflags", "bytemuck", @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "read-fonts" -version = "0.29.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce8e2ca6b24313587a03ca61bb74c384e2a815bd90cf2866cfc9f5fb7a11fa0" +checksum = "4e85935612710191461ec9df47b4b5880dd6359d4fad3b2f2ed696215f6f3146" dependencies = [ "bytemuck", "core_maths", @@ -111,9 +111,9 @@ dependencies = [ [[package]] name = "skrifa" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe6666ab11018ab91ff7b03f1a3b9fdbecfb610848436fefa5ce50343d3d913" +checksum = "b9c3bb8cab5196b98d70c866ce1ea81ab516104d5b396f84ae80f8766b5d5b4e" dependencies = [ "bytemuck", "read-fonts",