summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
Diffstat (limited to 'external')
-rw-r--r--external/cairo/UnpackedTarball_pixman.mk1
-rw-r--r--external/cairo/pixman/pixman-ubsan.patch11
2 files changed, 12 insertions, 0 deletions
diff --git a/external/cairo/UnpackedTarball_pixman.mk b/external/cairo/UnpackedTarball_pixman.mk
index 6669a8f8be66..cc3dbd11dcc0 100644
--- a/external/cairo/UnpackedTarball_pixman.mk
+++ b/external/cairo/UnpackedTarball_pixman.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,pixman,$(PIXMAN_TARBALL),,cairo))
$(eval $(call gb_UnpackedTarball_add_patches,pixman,\
external/cairo/pixman/pixman-0.24.4.patch \
external/cairo/pixman/pixman-ofz4372.patch \
+ external/cairo/pixman/pixman-ubsan.patch \
))
ifeq ($(OS),WNT)
diff --git a/external/cairo/pixman/pixman-ubsan.patch b/external/cairo/pixman/pixman-ubsan.patch
new file mode 100644
index 000000000000..339a26719947
--- /dev/null
+++ b/external/cairo/pixman/pixman-ubsan.patch
@@ -0,0 +1,11 @@
+--- misc/pixman/pixman/pixman.h
++++ misc/build/pixman/pixman/pixman.h
+@@ -127,7 +127,7 @@
+ #define pixman_fixed_1_minus_e (pixman_fixed_1 - pixman_fixed_e)
+ #define pixman_fixed_minus_1 (pixman_int_to_fixed(-1))
+ #define pixman_fixed_to_int(f) ((int) ((f) >> 16))
+-#define pixman_int_to_fixed(i) ((pixman_fixed_t) ((i) << 16))
++#define pixman_int_to_fixed(i) ((pixman_fixed_t) ((i) * (1 << 16)))
+ #define pixman_fixed_to_double(f) (double) ((f) / (double) pixman_fixed_1)
+ #define pixman_double_to_fixed(d) ((pixman_fixed_t) ((d) * 65536.0))
+ #define pixman_fixed_frac(f) ((f) & pixman_fixed_1_minus_e)