From e4a6fe1e5f32bbc2add7ecd80585a8c0614072c2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 7 May 2025 23:27:45 -0600 Subject: [PATCH] [harfruzz] Handle empty face blob Happens... --- src/rust/shape.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rust/shape.rs b/src/rust/shape.rs index f21a00cdf..aac28783a 100644 --- a/src/rust/shape.rs +++ b/src/rust/shape.rs @@ -22,6 +22,9 @@ pub unsafe extern "C" fn _hb_harfruzz_shaper_face_data_create_rs( let face_blob = hb_face_reference_blob(face); let blob_length = hb_blob_get_length(face_blob); let blob_data = hb_blob_get_data(face_blob, null_mut()); + if blob_data.is_null() { + return null_mut(); + } let face_data = std::slice::from_raw_parts(blob_data as *const u8, blob_length as usize); let font_ref = match FontRef::from_index(face_data, face_index) {