From 6deb75dfee687ec06fcf3d08a2d67d344507da1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 8 May 2025 11:27:10 +0100 Subject: [PATCH] use final upstream harfbuzz fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibc57f684d45ab59332f22546f36f0e5bf79c5d23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185067 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- ...e_to_break-whole-buffer-to-succeed.patch.1 | 32 ++++++++++++++ ...1-increase-maximum-set_flags-range.patch.1 | 44 ------------------- external/harfbuzz/UnpackedTarball_harfbuzz.mk | 5 +-- 3 files changed, 33 insertions(+), 48 deletions(-) create mode 100644 external/harfbuzz/0001-buffer-Allow-unsafe_to_break-whole-buffer-to-succeed.patch.1 delete mode 100644 external/harfbuzz/0001-increase-maximum-set_flags-range.patch.1 diff --git a/external/harfbuzz/0001-buffer-Allow-unsafe_to_break-whole-buffer-to-succeed.patch.1 b/external/harfbuzz/0001-buffer-Allow-unsafe_to_break-whole-buffer-to-succeed.patch.1 new file mode 100644 index 000000000000..497c9b02eb61 --- /dev/null +++ b/external/harfbuzz/0001-buffer-Allow-unsafe_to_break-whole-buffer-to-succeed.patch.1 @@ -0,0 +1,32 @@ +From 39896512cfd6f37e416cdc9c598e977d9548426a Mon Sep 17 00:00:00 2001 +From: Behdad Esfahbod +Date: Wed, 7 May 2025 16:11:37 -0600 +Subject: [PATCH] [buffer] Allow unsafe_to_break() whole buffer to succeed + +Fixes https://github.com/harfbuzz/harfbuzz/pull/5315 +--- + src/hb-buffer.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh +index 6c620db69..1a534aad2 100644 +--- a/src/hb-buffer.hh ++++ b/src/hb-buffer.hh +@@ -410,11 +410,11 @@ struct hb_buffer_t + bool interior = false, + bool from_out_buffer = false) + { +- end = hb_min (end, len); +- +- if (unlikely (end - start > 255)) ++ if (unlikely (end != (unsigned) -1 && end - start > 255)) + return; + ++ end = hb_min (end, len); ++ + if (interior && !from_out_buffer && end - start < 2) + return; + +-- +2.49.0 + diff --git a/external/harfbuzz/0001-increase-maximum-set_flags-range.patch.1 b/external/harfbuzz/0001-increase-maximum-set_flags-range.patch.1 deleted file mode 100644 index e0190d36eaa3..000000000000 --- a/external/harfbuzz/0001-increase-maximum-set_flags-range.patch.1 +++ /dev/null @@ -1,44 +0,0 @@ -From 3bb296559745a08d7d7d05bf3e39bf010c68de55 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 6 May 2025 11:48:46 +0100 -Subject: [PATCH] increase maximum set_flags range - -This a problem for LibreOffice since: - -commit 0d8717275ac5809812c254c1b0923f2fc052c582 -CommitDate: Tue Apr 22 15:40:06 2025 -0600 - - [buffer] Limit the extent of set_flags range - -where we now see an asset of: - -vcl/source/gdi/impglyphitem.cxx:319: void checkGlyphsEqual(const SalLayoutGlyphs&, const SalLayoutGlyphs&): Assertion `l1->isLayoutEquivalent(l2)' failed. - -as noted in https://gerrit.libreoffice.org/c/core/+/184761 - -on checking in debug-builds if reusing a subset of a previous laid out -string as a cache for the same subtext seen again does really give the -same results. - -In our test documents, empirically checking what number here works, -there's one case which still fails at len 2029 but succeeds at 2030. ---- - src/hb-buffer.hh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh -index 6c620db69..c922ec592 100644 ---- a/src/hb-buffer.hh -+++ b/src/hb-buffer.hh -@@ -412,7 +412,7 @@ struct hb_buffer_t - { - end = hb_min (end, len); - -- if (unlikely (end - start > 255)) -+ if (unlikely (end - start >= 2048)) - return; - - if (interior && !from_out_buffer && end - start < 2) --- -2.49.0 - diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk index f54c936ff9a1..dd365dd45e5f 100644 --- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk +++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk @@ -15,13 +15,10 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,harfbuzz)) $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0)) -# See https://github.com/harfbuzz/harfbuzz/pull/5315 for -# 0001-increase-maximum-set_flags-range.patch.1 - $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \ external/harfbuzz/tdf159529.patch.0 \ external/harfbuzz/harfbuzz_visibility.patch.1 \ - external/harfbuzz/0001-increase-maximum-set_flags-range.patch.1 \ + external/harfbuzz/0001-buffer-Allow-unsafe_to_break-whole-buffer-to-succeed.patch.1 \ )) # meson will replace python3 from shebang in build commands with the