[Libreoffice-commits] core.git: external/pdfium

Stephan Bergmann sbergman at redhat.com
Tue Feb 14 08:11:34 UTC 2017


 external/pdfium/UnpackedTarball_pdfium.mk |    3 +++
 external/pdfium/ubsan.patch               |   19 +++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit a9124aceb9907fc56cb8379dd586df0deb7e31f0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Feb 14 09:11:07 2017 +0100

    external/pdfium: Work around -fsanitize=shift
    
    ...during CppunitTest_sd_export_tests
    
    Change-Id: Id253fd83a6056783a55f9496ac850dc00e89253d

diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index 0cad016..17ddd9b 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -13,11 +13,14 @@ pdfium_patches += visibility.patch.1
 pdfium_patches += msvc.patch.1
 # To support macOS 10.9 baseline.
 pdfium_patches += macos.patch.1
+pdfium_patches += ubsan.patch
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,pdfium,$(PDFIUM_TARBALL)))
 
+$(eval $(call gb_UnpackedTarball_set_patchlevel,pdfium,0))
+
 $(eval $(call gb_UnpackedTarball_add_patches,pdfium,\
     $(foreach patch,$(pdfium_patches),external/pdfium/$(patch)) \
 ))
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
new file mode 100644
index 0000000..08864b3
--- /dev/null
+++ b/external/pdfium/ubsan.patch
@@ -0,0 +1,19 @@
+--- third_party/agg23/agg_rasterizer_scanline_aa.h
++++ third_party/agg23/agg_rasterizer_scanline_aa.h
+@@ -349,14 +349,14 @@
+                     cover += cur_cell->cover;
+                 }
+                 if(area) {
+-                    alpha = calculate_alpha((cover << (poly_base_shift + 1)) - area, no_smooth);
++                    alpha = calculate_alpha(int(unsigned(cover) << (poly_base_shift + 1)) - area, no_smooth);
+                     if(alpha) {
+                         sl.add_cell(x, alpha);
+                     }
+                     x++;
+                 }
+                 if(num_cells && cur_cell->x > x) {
+-                    alpha = calculate_alpha(cover << (poly_base_shift + 1), no_smooth);
++                    alpha = calculate_alpha(unsigned(cover) << (poly_base_shift + 1), no_smooth);
+                     if(alpha) {
+                         sl.add_span(x, cur_cell->x - x, alpha);
+                     }


More information about the Libreoffice-commits mailing list