summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-12 16:29:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-12 16:30:31 +0100
commitac05275755240dbd35f4ea802a8efb2fa4aaa85d (patch)
tree72b576f72b3e3fdb5d7bb396dacf546f3455274a /external
parente4fea6e67a05256c3ce6336bf054004015936310 (diff)
Fix alpha computation (-fsanitize=undefined)
Change-Id: I3f50d3bb85bebdece692e069de73febc2ce63b47
Diffstat (limited to 'external')
-rw-r--r--external/libebook/UnpackedTarball_libebook.mk6
-rw-r--r--external/libebook/ubsan.patch11
2 files changed, 16 insertions, 1 deletions
diff --git a/external/libebook/UnpackedTarball_libebook.mk b/external/libebook/UnpackedTarball_libebook.mk
index 7dfee2c7550d..5c02bf4f9f2e 100644
--- a/external/libebook/UnpackedTarball_libebook.mk
+++ b/external/libebook/UnpackedTarball_libebook.mk
@@ -11,6 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libebook))
$(eval $(call gb_UnpackedTarball_set_tarball,libebook,$(EBOOK_TARBALL)))
-$(eval $(call gb_UnpackedTarball_set_patchlevel,libebook,1))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libebook,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libebook, \
+ external/libebook/ubsan.patch \
+))
# vim: set noet sw=4 ts=4:
diff --git a/external/libebook/ubsan.patch b/external/libebook/ubsan.patch
new file mode 100644
index 000000000000..0a3ead259ea7
--- /dev/null
+++ b/external/libebook/ubsan.patch
@@ -0,0 +1,11 @@
+--- src/lib/LRFCollector.cpp
++++ src/lib/LRFCollector.cpp
+@@ -50,7 +50,7 @@
+ {
+ assert(0 == bg.a);
+
+- const double a = fg.a;
++ const double a = fg.a / 255.0;
+
+ const double r = (1 - a) * bg.r + a * fg.r;
+ const double g = (1 - a) * bg.g + a * fg.g;