download.lst                                   |    4 +-
 external/pdfium/Library_pdfium.mk              |    1 
 external/pdfium/UnpackedTarball_pdfium.mk      |    2 -
 external/pdfium/build.patch.1                  |   50 ++++++++++++-------------
 external/pdfium/buildfix-7.patch.1             |   13 ++++++
 external/pdfium/buildfix.patch.1               |   10 -----
 external/pdfium/inc/pch/precompiled_pdfium.hxx |    5 +-
 external/pdfium/ubsan.patch                    |   12 ------
 8 files changed, 45 insertions(+), 52 deletions(-)

New commits:
commit bfeb19d86f9bcd7c97e64eae0172442120828c75
Author:     Miklos Vajna <[email protected]>
AuthorDate: Tue Dec 12 20:16:40 2023 +0100
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Nov 12 09:20:12 2025 +0100

    Update pdfium to 6179
    
    - Remove ubsan.patch, upstream switched to FXSYS_memset() in this
      function, which does a similar length check as our patch did.
    
    Change-Id: Ib418cd8e642d2be9f448c92f25f85bec25e34598
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160627
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit 918515d6fc6e2eaa000c4a997d604b7b00b492e3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160644
    (cherry picked from commit ba39aecc5e885f6bac30d4ba079913d0227a30c1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193820
    Tested-by: allotropia jenkins <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/download.lst b/download.lst
index 0ff8783d95ea..19c1f6f353b8 100644
--- a/download.lst
+++ b/download.lst
@@ -455,8 +455,8 @@ PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-PDFIUM_SHA256SUM := 
021456a0ddfa473855651496e277b6e1493dbf9572fce4e3204f7580964b42c7
-PDFIUM_TARBALL := pdfium-6060.tar.bz2
+PDFIUM_SHA256SUM := 
4d3f08fe0e2fda86246832085426616826dcca0912202874428bfbc24d13d95c
+PDFIUM_TARBALL := pdfium-6179.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/pdfium/Library_pdfium.mk 
b/external/pdfium/Library_pdfium.mk
index 0b11ba9c3f2b..d7bb11b2d847 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -435,6 +435,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxge/dib/cfx_scanlinecompositor \
     UnpackedTarball/pdfium/core/fxge/dib/cstretchengine \
     UnpackedTarball/pdfium/core/fxge/dib/fx_dib \
+    UnpackedTarball/pdfium/core/fxge/dib/blend \
     UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitDingbats \
     UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixed \
     UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedBold \
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index 0948af0bd4cc..fbfa196bba69 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -9,8 +9,8 @@
 
 pdfium_patches :=
 pdfium_patches += buildfix.patch.1
+pdfium_patches += buildfix-7.patch.1
 pdfium_patches += fa84e52-revert.patch.1
-pdfium_patches += ubsan.patch
 # Fixes build on our baseline.
 pdfium_patches += build.patch.1
 pdfium_patches += msvc2017.patch.1
diff --git a/external/pdfium/buildfix-7.patch.1 
b/external/pdfium/buildfix-7.patch.1
new file mode 100644
index 000000000000..96e1c594eb95
--- /dev/null
+++ b/external/pdfium/buildfix-7.patch.1
@@ -0,0 +1,13 @@
+fix weird link failures on centos7:
+pdfium/core/fpdfdoc/cpdf_formcontrol.cpp:134: undefined reference to 
`fxcrt::StringViewTemplate<char>::StringViewTemplate(char const&)'
+--- pdfium/core/fxcrt/string_view_template.h.orig      2025-11-11 
13:26:05.268265314 +0100
++++ pdfium/core/fxcrt/string_view_template.h   2025-11-11 13:26:36.836918076 
+0100
+@@ -73,7 +73,7 @@
+   // Deliberately implicit to avoid calling on every char literal.
+   // |ch| must be an lvalue that outlives the StringViewTemplate.
+   // NOLINTNEXTLINE(runtime/explicit)
+-  constexpr StringViewTemplate(const CharType& ch) noexcept
++  StringViewTemplate(const CharType& ch) noexcept
+       : m_Span(reinterpret_cast<const UnsignedType*>(&ch), 1u) {}
+ 
+   StringViewTemplate& operator=(const CharType* src) {
diff --git a/external/pdfium/buildfix.patch.1 b/external/pdfium/buildfix.patch.1
index 60d65558fe6f..da40ca393efe 100644
--- a/external/pdfium/buildfix.patch.1
+++ b/external/pdfium/buildfix.patch.1
@@ -9,13 +9,3 @@ GCC 15 fix
  
  class CJBig2_SymbolDict;
  
---- pdfium/third_party/base/containers/span.h.orig     2025-11-11 
11:46:46.901027677 +0100
-+++ pdfium/third_party/base/containers/span.h  2025-11-11 11:46:48.815049574 
+0100
-@@ -6,6 +6,7 @@
- #define THIRD_PARTY_BASE_CONTAINERS_SPAN_H_
- 
- #include <stddef.h>
-+#include <stdint.h>
- 
- #include <algorithm>
- #include <array>
diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx 
b/external/pdfium/inc/pch/precompiled_pdfium.hxx
index 64795df4054d..c58757bc605d 100644
--- a/external/pdfium/inc/pch/precompiled_pdfium.hxx
+++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx
@@ -334,7 +334,6 @@
 #include <core/fxcrt/pauseindicator_iface.h>
 #include <core/fxcrt/retain_ptr.h>
 #include <core/fxcrt/scoped_set_insertion.h>
-#include <core/fxcrt/small_buffer.h>
 #include <core/fxcrt/span_util.h>
 #include <core/fxcrt/stl_util.h>
 #include <core/fxcrt/string_data_template.h>
@@ -375,6 +374,7 @@
 #include <core/fxge/cfx_substfont.h>
 #include <core/fxge/cfx_textrenderoptions.h>
 #include <core/fxge/cfx_unicodeencoding.h>
+#include <core/fxge/dib/blend.h>
 #include <core/fxge/dib/cfx_bitmapcomposer.h>
 #include <core/fxge/dib/cfx_bitmapstorer.h>
 #include <core/fxge/dib/cfx_cmyk_to_srgb.h>
@@ -458,6 +458,7 @@
 #include <public/fpdf_text.h>
 #include <public/fpdf_transformpage.h>
 #include <public/fpdfview.h>
+#include <third_party/abseil-cpp/absl/container/inlined_vector.h>
 #include <third_party/abseil-cpp/absl/types/optional.h>
 #include <third_party/abseil-cpp/absl/types/variant.h>
 #include <third_party/agg23/agg_clip_liang_barsky.h>
@@ -478,8 +479,8 @@
 #include <third_party/base/debug/alias.h>
 #include <third_party/base/memory/aligned_memory.h>
 #include <third_party/base/memory/ptr_util.h>
-#include <third_party/base/no_destructor.h>
 #include <third_party/base/notreached.h>
+#include <third_party/base/numerics/clamped_math.h>
 #include <third_party/base/numerics/safe_conversions.h>
 #include <third_party/base/numerics/safe_math.h>
 #endif // PCH_LEVEL >= 3
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
deleted file mode 100644
index 039505eda9cf..000000000000
--- a/external/pdfium/ubsan.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- core/fxge/cfx_glyphcache.cpp
-+++ core/fxge/cfx_glyphcache.cpp
-@@ -183,7 +183,8 @@ std::unique_ptr<CFX_GlyphBitmap> 
CFX_GlyphCache::RenderGlyph(
-       }
-     }
-   } else {
--    memset(pDestBuf, 0, dest_pitch * bmheight);
-+    if (dest_pitch != 0 && bmheight != 0)
-+      memset(pDestBuf, 0, dest_pitch * bmheight);
-     int rowbytes = std::min(abs(src_pitch), dest_pitch);
-     for (int row = 0; row < bmheight; row++)
-       memcpy(pDestBuf + row * dest_pitch, pSrcBuf + row * src_pitch, 
rowbytes);
commit 5caa9f04db013d05e7036e98c73a5f01bb9804a7
Author:     Miklos Vajna <[email protected]>
AuthorDate: Wed Oct 11 20:06:04 2023 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Nov 12 09:20:03 2025 +0100

    Update to pdfium 6060
    
    - external/pdfium/build.patch.1: re-generate with 'patch -p1' + 'git
      diff'
    
    Change-Id: I9258d6d0130620523d64fcd0854c4d96fc98a4bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157846
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit faa590cf41a08169306ec369948b31d0401518a3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193819
    Tested-by: allotropia jenkins <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/download.lst b/download.lst
index 01f5ab2eca80..0ff8783d95ea 100644
--- a/download.lst
+++ b/download.lst
@@ -455,8 +455,8 @@ PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-PDFIUM_SHA256SUM := 
9a9ce3f62de525cdfd8373a155ac549579c2c8067c6050716ca4b5cd5c11f655
-PDFIUM_TARBALL := pdfium-5941.tar.bz2
+PDFIUM_SHA256SUM := 
021456a0ddfa473855651496e277b6e1493dbf9572fce4e3204f7580964b42c7
+PDFIUM_TARBALL := pdfium-6060.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index 3ea20d8b8aa1..675b346cb868 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -1,9 +1,9 @@
 -*- Mode: diff -*-
 diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp 
b/core/fpdfapi/font/cpdf_cidfont.cpp
-index f5a51b24e..8b308d0a6 100644
+index 7d2d549b8..c4864060a 100644
 --- a/core/fpdfapi/font/cpdf_cidfont.cpp
 +++ b/core/fpdfapi/font/cpdf_cidfont.cpp
-@@ -755,7 +755,7 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, 
bool* pVertGlyph) {
+@@ -754,7 +754,7 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, 
bool* pVertGlyph) {
          uint32_t maccode = CharCodeFromUnicodeForFreetypeEncoding(
              FT_ENCODING_APPLE_ROMAN, name_unicode);
          index = maccode ? FT_Get_Char_Index(face, maccode)
@@ -13,10 +13,10 @@ index f5a51b24e..8b308d0a6 100644
        if (index == 0 || index == 0xffff)
          return charcode ? static_cast<int>(charcode) : -1;
 diff --git a/core/fpdfapi/font/cpdf_truetypefont.cpp 
b/core/fpdfapi/font/cpdf_truetypefont.cpp
-index 0a59b54eb..a96e11759 100644
+index f19ace9d0..562b015f0 100644
 --- a/core/fpdfapi/font/cpdf_truetypefont.cpp
 +++ b/core/fpdfapi/font/cpdf_truetypefont.cpp
-@@ -91,7 +91,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
+@@ -90,7 +90,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
                FT_ENCODING_APPLE_ROMAN,
                m_Encoding.UnicodeFromCharCode(charcode));
            if (!maccode) {
@@ -25,7 +25,7 @@ index 0a59b54eb..a96e11759 100644
            } else {
              m_GlyphIndex[charcode] = FT_Get_Char_Index(face, maccode);
            }
-@@ -105,7 +105,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
+@@ -104,7 +104,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
          m_GlyphIndex[charcode] = FT_Get_Char_Index(face, 32);
          continue;
        }
@@ -57,7 +57,7 @@ index 55510e7d7..2f13f00b8 100644
        continue;
  
 diff --git a/core/fpdfdoc/cpdf_metadata.cpp b/core/fpdfdoc/cpdf_metadata.cpp
-index 228a0c137..bf512beb3 100644
+index 31564f45f..5858549ef 100644
 --- a/core/fpdfdoc/cpdf_metadata.cpp
 +++ b/core/fpdfdoc/cpdf_metadata.cpp
 @@ -87,7 +87,7 @@ std::vector<UnsupportedFeature> 
CPDF_Metadata::CheckForSharedForm() const {
@@ -85,10 +85,10 @@ index 228a0c137..bf512beb3 100644
    uint8_t r;
    uint8_t g;
 diff --git a/core/fxcodec/jpx/cjpx_decoder.cpp 
b/core/fxcodec/jpx/cjpx_decoder.cpp
-index 9391d61ab..490ce2230 100644
+index 2e7a72aa1..65fb3deaa 100644
 --- a/core/fxcodec/jpx/cjpx_decoder.cpp
 +++ b/core/fxcodec/jpx/cjpx_decoder.cpp
-@@ -75,7 +75,7 @@ absl::optional<OpjImageRgbData> alloc_rgb(size_t size) {
+@@ -74,7 +74,7 @@ absl::optional<OpjImageRgbData> alloc_rgb(size_t size) {
    if (!data.b)
      return absl::nullopt;
  
@@ -97,21 +97,8 @@ index 9391d61ab..490ce2230 100644
  }
  
  void sycc_to_rgb(int offset,
-diff --git a/third_party/base/numerics/safe_conversions_impl.h 
b/third_party/base/numerics/safe_conversions_impl.h
-index 44c921a14..0152a89b7 100644
---- a/third_party/base/numerics/safe_conversions_impl.h
-+++ b/third_party/base/numerics/safe_conversions_impl.h
-@@ -89,7 +89,7 @@ constexpr typename std::make_unsigned<T>::type 
SafeUnsignedAbs(T value) {
- 
- // TODO(jschuh): Switch to std::is_constant_evaluated() once C++20 is 
supported.
- // Alternately, the usage could be restructured for "consteval if" in C++23.
--#define IsConstantEvaluated() (__builtin_is_constant_evaluated())
-+#define IsConstantEvaluated() (false)
- 
- // TODO(jschuh): Debug builds don't reliably propagate constants, so we 
restrict
- // some accelerated runtime paths to release builds until this can be forced
 diff --git a/third_party/base/containers/span.h 
b/third_party/base/containers/span.h
-index ed2a3c8de..87493861c 100644
+index 435fafa85..d8e8bfbc4 100644
 --- a/third_party/base/containers/span.h
 +++ b/third_party/base/containers/span.h
 @@ -211,7 +211,7 @@ class TRIVIAL_ABI GSL_POINTER span {
@@ -131,12 +118,25 @@ index ed2a3c8de..87493861c 100644
 +  span(const span<U>& other) : span(other.data(), other.size()) {}
    span& operator=(const span& other) noexcept {
      if (this != &other) {
-       ReleaseEmptySpan();
+       data_ = other.data_;
+diff --git a/third_party/base/numerics/safe_conversions_impl.h 
b/third_party/base/numerics/safe_conversions_impl.h
+index 44c921a14..0152a89b7 100644
+--- a/third_party/base/numerics/safe_conversions_impl.h
++++ b/third_party/base/numerics/safe_conversions_impl.h
+@@ -89,7 +89,7 @@ constexpr typename std::make_unsigned<T>::type 
SafeUnsignedAbs(T value) {
+ 
+ // TODO(jschuh): Switch to std::is_constant_evaluated() once C++20 is 
supported.
+ // Alternately, the usage could be restructured for "consteval if" in C++23.
+-#define IsConstantEvaluated() (__builtin_is_constant_evaluated())
++#define IsConstantEvaluated() (false)
+ 
+ // TODO(jschuh): Debug builds don't reliably propagate constants, so we 
restrict
+ // some accelerated runtime paths to release builds until this can be forced
 diff --git a/third_party/libopenjpeg/openjpeg.c 
b/third_party/libopenjpeg/openjpeg.c
-index 29d3ee528..d5c7a1bc9 100644
+index 9dd4256d7..949d65830 100644
 --- a/third_party/libopenjpeg/openjpeg.c
 +++ b/third_party/libopenjpeg/openjpeg.c
-@@ -433,7 +433,7 @@ OPJ_BOOL OPJ_CALLCONV opj_setup_decoder(opj_codec_t 
*p_codec,
+@@ -358,7 +358,7 @@ OPJ_BOOL OPJ_CALLCONV opj_setup_decoder(opj_codec_t 
*p_codec,
      return OPJ_FALSE;
  }
  

Reply via email to