From 7707339a7d10225ff2503a852f68427519ae26f6 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 13 Jul 2021 20:28:17 +0200 Subject: external: update pdfium to 4568 Change-Id: I2bfd5f806281e747702d423b7e59b5f88a7bea9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118868 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- external/pdfium/Library_pdfium.mk | 12 ++- external/pdfium/build.patch.1 | 109 ++++++++++++++++++++++++- external/pdfium/inc/pch/precompiled_pdfium.hxx | 16 +++- external/pdfium/ubsan.patch | 8 +- 4 files changed, 131 insertions(+), 14 deletions(-) (limited to 'external/pdfium') diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk index e048c8dab0d5..1cec5c19573d 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -77,6 +77,12 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_interactiveform \ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_renderpage \ UnpackedTarball/pdfium/fpdfsdk/fpdf_signature \ + UnpackedTarball/pdfium/constants/annotation_common \ + UnpackedTarball/pdfium/constants/appearance \ + UnpackedTarball/pdfium/constants/form_fields \ + UnpackedTarball/pdfium/constants/page_object \ + UnpackedTarball/pdfium/constants/stream_dict_common \ + UnpackedTarball/pdfium/constants/transparency \ )) # fdrm @@ -90,7 +96,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_checkbox \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_combobox \ - UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_formfiller \ + UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_formfield \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_interactiveformfiller \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_listbox \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_pushbutton \ @@ -347,7 +353,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_SymbolDict \ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_TrdProc \ UnpackedTarball/pdfium/core/fxcodec/gif/cfx_gif \ - UnpackedTarball/pdfium/core/fxcodec/gif/cfx_lzwdecompressor \ + UnpackedTarball/pdfium/core/fxcodec/gif/lzw_decompressor \ UnpackedTarball/pdfium/core/fxcodec/cfx_codec_memory \ UnpackedTarball/pdfium/core/fxcodec/fax/faxmodule \ UnpackedTarball/pdfium/core/fxcodec/scanlinedecoder \ @@ -460,7 +466,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/cfx_gemodule \ UnpackedTarball/pdfium/core/fxge/cfx_graphstate \ UnpackedTarball/pdfium/core/fxge/cfx_graphstatedata \ - UnpackedTarball/pdfium/core/fxge/cfx_pathdata \ + UnpackedTarball/pdfium/core/fxge/cfx_path \ UnpackedTarball/pdfium/core/fxge/cfx_renderdevice \ UnpackedTarball/pdfium/core/fxge/cfx_substfont \ UnpackedTarball/pdfium/core/fxge/cfx_unicodeencoding \ diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1 index 9d48b022fae2..b4c69ba00f84 100644 --- a/external/pdfium/build.patch.1 +++ b/external/pdfium/build.patch.1 @@ -38,12 +38,115 @@ index 0fb627ba8..dda1fc8bc 100644 template < typename Container, diff --git a/core/fxcodec/jpx/cjpx_decoder.cpp b/core/fxcodec/jpx/cjpx_decoder.cpp -index dbc1b1045..36b72461d 100644 +index c66985a7f..9c1122b75 100644 --- a/core/fxcodec/jpx/cjpx_decoder.cpp +++ b/core/fxcodec/jpx/cjpx_decoder.cpp -@@ -70,7 +70,7 @@ Optional alloc_rgb(size_t size) { +@@ -6,6 +6,8 @@ + + #include "core/fxcodec/jpx/cjpx_decoder.h" + ++#include ++ + #include + #include + #include +diff --git a/core/fxcodec/jpeg/jpegmodule.cpp b/core/fxcodec/jpeg/jpegmodule.cpp +index cea0679aa..036f25003 100644 +--- a/core/fxcodec/jpeg/jpegmodule.cpp ++++ b/core/fxcodec/jpeg/jpegmodule.cpp +@@ -7,6 +7,7 @@ + #include "core/fxcodec/jpeg/jpegmodule.h" + + #include ++#include + + #include + #include +diff --git a/core/fxge/dib/cfx_bitmapcomposer.cpp b/core/fxge/dib/cfx_bitmapcomposer.cpp +index 6f9b42013..0f1ffae2c 100644 +--- a/core/fxge/dib/cfx_bitmapcomposer.cpp ++++ b/core/fxge/dib/cfx_bitmapcomposer.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_bitmapcomposer.h" + ++#include ++ + #include "core/fxge/cfx_cliprgn.h" + #include "core/fxge/dib/cfx_dibitmap.h" + +diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp +index d7ccf6cfa..94e8accdd 100644 +--- a/core/fxge/dib/cfx_dibitmap.cpp ++++ b/core/fxge/dib/cfx_dibitmap.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_dibitmap.h" + ++#include ++ + #include + #include + #include +diff --git a/core/fxge/dib/cfx_bitmapstorer.cpp b/core/fxge/dib/cfx_bitmapstorer.cpp +index f57c00eaa..45a0a180c 100644 +--- a/core/fxge/dib/cfx_bitmapstorer.cpp ++++ b/core/fxge/dib/cfx_bitmapstorer.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_bitmapstorer.h" + ++#include ++ + #include + + #include "core/fxge/dib/cfx_dibitmap.h" +diff --git a/core/fxge/cfx_cliprgn.cpp b/core/fxge/cfx_cliprgn.cpp +index 5369d522c..d198852e3 100644 +--- a/core/fxge/cfx_cliprgn.cpp ++++ b/core/fxge/cfx_cliprgn.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/cfx_cliprgn.h" + ++#include ++ + #include + + #include "core/fxge/dib/cfx_dibitmap.h" +diff --git a/core/fxge/dib/cfx_scanlinecompositor.cpp b/core/fxge/dib/cfx_scanlinecompositor.cpp +index e8362d708..c04c6dcab 100644 +--- a/core/fxge/dib/cfx_scanlinecompositor.cpp ++++ b/core/fxge/dib/cfx_scanlinecompositor.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_scanlinecompositor.h" + ++#include ++ + #include + + #include "core/fxge/dib/fx_dib.h" +diff --git a/core/fxge/dib/cfx_dibbase.cpp b/core/fxge/dib/cfx_dibbase.cpp +index 4ec0ddbf9..a1de2fbec 100644 +--- a/core/fxge/dib/cfx_dibbase.cpp ++++ b/core/fxge/dib/cfx_dibbase.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_dibbase.h" + ++#include ++ + #include + #include + #include +diff --git a/core/fxcodec/jpx/cjpx_decoder.cpp b/core/fxcodec/jpx/cjpx_decoder.cpp +index c66985a7f..817f81dfa 100644 +--- a/core/fxcodec/jpx/cjpx_decoder.cpp ++++ b/core/fxcodec/jpx/cjpx_decoder.cpp +@@ -71,7 +71,7 @@ Optional alloc_rgb(size_t size) { if (!data.b) - return {}; + return pdfium::nullopt; - return data; + return std::move(data); diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx b/external/pdfium/inc/pch/precompiled_pdfium.hxx index d12256852e72..f01e704c7ee4 100644 --- a/external/pdfium/inc/pch/precompiled_pdfium.hxx +++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -241,7 +244,7 @@ #include #include #include -#include +#include #include #include #include @@ -320,6 +323,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -348,7 +354,7 @@ #include #include #include -#include +#include #include #include #include @@ -396,7 +402,7 @@ #include #include #include -#include +#include #include #include #include @@ -472,16 +478,18 @@ #include #include #include +#include +#include #include #include #include #include +#include #include #include #include #include #include -#include #include #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch index cd48b3ee4803..bc9868244275 100644 --- a/external/pdfium/ubsan.patch +++ b/external/pdfium/ubsan.patch @@ -1,9 +1,9 @@ --- core/fxcrt/string_data_template.cpp +++ core/fxcrt/string_data_template.cpp -@@ -83,7 +83,8 @@ void StringDataTemplate::CopyContentsAt(size_t offset, - DCHECK(nLen >= 0); - DCHECK(offset + nLen <= m_nAllocLength); - +@@ -82,7 +82,8 @@ void StringDataTemplate::CopyContentsAt(size_t offset, + DCHECK_GE(offset, 0); + DCHECK_GE(nLen, 0); + DCHECK_LE(offset + nLen, m_nAllocLength); - memcpy(m_String + offset, pStr, nLen * sizeof(CharType)); + if (nLen != 0) + memcpy(m_String + offset, pStr, nLen * sizeof(CharType)); -- cgit