[Libreoffice-commits] core.git: external/jpeg-turbo
Stephan Bergmann
sbergman at redhat.com
Wed Jan 7 01:41:34 PST 2015
external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk | 3 ++
external/jpeg-turbo/ubsan.patch | 31 ++++++++++++++++++++++
2 files changed, 34 insertions(+)
New commits:
commit 01c7e2c246e231d70bb7c1c9b5ad7fd5e4614951
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Jan 7 10:40:37 2015 +0100
external/jpeg-turbo: Work around -fsanitize=shift
Change-Id: I9ba85592a0d4d2052dd05abb8f4d2976ec1c95cc
diff --git a/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk b/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
index 2cb2aa4..7f97422 100644
--- a/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
+++ b/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
@@ -11,9 +11,12 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,jpeg-turbo))
$(eval $(call gb_UnpackedTarball_set_tarball,jpeg-turbo,$(JPEG_TURBO_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,jpeg-turbo,0))
+
$(eval $(call gb_UnpackedTarball_add_patches,jpeg-turbo,\
external/jpeg-turbo/jpeg-turbo.build.patch.1 \
$(if $(filter WNT,$(OS)),external/jpeg-turbo/jpeg-turbo.win_build.patch.1) \
+ external/jpeg-turbo/ubsan.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/jpeg-turbo/ubsan.patch b/external/jpeg-turbo/ubsan.patch
new file mode 100644
index 0000000..fcd5bcf
--- /dev/null
+++ b/external/jpeg-turbo/ubsan.patch
@@ -0,0 +1,31 @@
+--- jdhuff.c
++++ jdhuff.c
+@@ -489,7 +489,7 @@
+ #define AVOID_TABLES
+ #ifdef AVOID_TABLES
+
+-#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((-1)<<(s)) + 1)))
++#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((unsigned)-1<<(s)) + 1)))
+
+ #else
+
+--- jdphuff.c
++++ jdphuff.c
+@@ -201,7 +201,7 @@
+ #define AVOID_TABLES
+ #ifdef AVOID_TABLES
+
+-#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
++#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((unsigned)-1<<(s)) + 1) : (x))
+
+ #else
+
+@@ -334,7 +334,7 @@
+ s += state.last_dc_val[ci];
+ state.last_dc_val[ci] = s;
+ /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
+- (*block)[0] = (JCOEF) (s << Al);
++ (*block)[0] = (JCOEF) ((unsigned)s << Al);
+ }
+
+ /* Completed MCU, so update state */
More information about the Libreoffice-commits
mailing list