summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-13 11:19:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-13 11:21:04 +0100
commit4fc8d14751879c7837e38dd1d626e1bc3870e03d (patch)
tree05d496ccc14b01c2539663be13d497b123493a15 /external
parentc4ff0a78da9a57b445fe13d7c278576d3fa89a0f (diff)
external/libvisio: -fsanitize=float-divide-by-zero
...when running CppunitTest_writerperfect_draw Change-Id: I074512f56ebb7eb054c79946c576516036bebbea
Diffstat (limited to 'external')
-rw-r--r--external/libvisio/UnpackedTarball_libvisio.mk3
-rw-r--r--external/libvisio/ubsan.patch15
2 files changed, 18 insertions, 0 deletions
diff --git a/external/libvisio/UnpackedTarball_libvisio.mk b/external/libvisio/UnpackedTarball_libvisio.mk
index 31908332a43f..caae90391ec5 100644
--- a/external/libvisio/UnpackedTarball_libvisio.mk
+++ b/external/libvisio/UnpackedTarball_libvisio.mk
@@ -11,8 +11,11 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libvisio))
$(eval $(call gb_UnpackedTarball_set_tarball,libvisio,$(VISIO_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libvisio,0))
+
$(eval $(call gb_UnpackedTarball_add_patches,libvisio,\
external/libvisio/vsd-msvc-max.patch.1 \
+ external/libvisio/ubsan.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/libvisio/ubsan.patch b/external/libvisio/ubsan.patch
new file mode 100644
index 000000000000..16b0ec4bf71a
--- /dev/null
+++ b/external/libvisio/ubsan.patch
@@ -0,0 +1,15 @@
+--- src/lib/VSDParser.cpp
++++ src/lib/VSDParser.cpp
+@@ -1104,7 +1104,11 @@
+ input->seek(1, librevenge::RVNG_SEEK_CUR);
+ double scale = readDouble(input);
+ input->seek(1, librevenge::RVNG_SEEK_CUR);
+- scale /= readDouble(input);
++ double scaleDenom = readDouble(input);
++ if (scaleDenom != 0)
++ {
++ scale /= scaleDenom;
++ }
+
+ if (m_isStencilStarted && m_currentStencil)
+ {