summaryrefslogtreecommitdiff
path: root/external/jpeg-turbo
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-02-09 18:18:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-02-09 18:18:06 +0100
commit721f53712a2b291c559b7ae42bc17538ca5bc8ac (patch)
tree149c59cee0114582fca800abaa72335dae56d476 /external/jpeg-turbo
parent0c14c7babb71588fd93c1adccf4a99bf1b65dbd3 (diff)
external/jpeg-turbo: Avoid -fsanitize=shift
Change-Id: If039e70f4e533d8253f272c3f45fbc980b37e0c8
Diffstat (limited to 'external/jpeg-turbo')
-rw-r--r--external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk1
-rw-r--r--external/jpeg-turbo/ubsan.patch11
2 files changed, 12 insertions, 0 deletions
diff --git a/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk b/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
index 0e252baf0021..7f974228d5d0 100644
--- a/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
+++ b/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
@@ -16,6 +16,7 @@ $(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 000000000000..46d718bdd6b4
--- /dev/null
+++ b/external/jpeg-turbo/ubsan.patch
@@ -0,0 +1,11 @@
+--- jcphuff.c
++++ jcphuff.c
+@@ -255,7 +255,7 @@
+ if (c == 0xFF) { /* need to stuff a zero byte? */
+ emit_byte(entropy, 0);
+ }
+- put_buffer <<= 8;
++ put_buffer = (unsigned) put_buffer << 8;
+ put_bits -= 8;
+ }
+