From: Caolán McNamara Date: Wed, 6 May 2026 14:37:30 +0000 (+0100) Subject: [PATCH] check for hb_shape_full failure X-Git-Tag: archive/raspbian/4%7.4.7-1+rpi1+deb12u14^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1873ad501df8f0fffb76a3cf1007fd22b70ba810;p=libreoffice.git [PATCH] check for hb_shape_full failure Signed-off-by: Caolán McNamara Change-Id: I5fafcb7d592fb4c9091cb2bab64cb6ac47462d71 Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2102 Reviewed-by: Miklos Vajna (cherry picked from commit 22c19be8fae977a90f83a82d8acccd0b46c7cf20) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204946 Tested-by: Jenkins Reviewed-by: Julien Nabet Gbp-Pq: Name check-for-hb_shape_full-failure.diff --- diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 7e2bcd6290c..c9f3f4f09a4 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -465,9 +465,11 @@ bool GenericSalLayout::LayoutText(vcl::text::ImplLayoutArgs& rArgs, const SalLay // but there is no harm in always including it, HarfBuzz will // ignore unavailable shapers. const char*const pHbShapers[] = { "graphite2", "coretext_aat", "ot", "fallback", nullptr }; - bool ok = hb_shape_full(pHbFont, pHbBuffer, maFeatures.data(), maFeatures.size(), pHbShapers); - assert(ok); - (void) ok; + if (!hb_shape_full(pHbFont, pHbBuffer, maFeatures.data(), maFeatures.size(), pHbShapers)) + { + SAL_WARN("vcl.harfbuzz", "hb_shape_full failed"); + hb_buffer_set_length(pHbBuffer, 0); + } int nRunGlyphCount = hb_buffer_get_length(pHbBuffer); hb_glyph_info_t *pHbGlyphInfos = hb_buffer_get_glyph_infos(pHbBuffer, nullptr);