summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Rösner <rndxelement@protonmail.com>2022-06-29 21:36:48 +0200
committerFlorian Schmaus <flow@gentoo.org>2022-06-30 14:43:29 +0200
commite69ffe486e072430217eb921a1886f93d8d74534 (patch)
treebdfdd31bea11209b58ceca0b9ee4da632760a3c3
parentsys-apps/gptfdisk: Stabilize 1.0.9-r1 x86, #855296 (diff)
downloadgentoo-e69ffe486e072430217eb921a1886f93d8d74534.tar.gz
gentoo-e69ffe486e072430217eb921a1886f93d8d74534.tar.bz2
gentoo-e69ffe486e072430217eb921a1886f93d8d74534.zip
app-text/mupdf: fix strict-aliasing violations
Fix two issues in thirdparty/lcms2/src/cmsplugin.c regarding strinct-aliasing rule violations. Closes: https://bugs.gentoo.org/855020 Signed-off-by: Philipp Rösner <rndxelement@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/26152 Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r--app-text/mupdf/files/mupdf-1.20.0-lcms2.patch20
-rw-r--r--app-text/mupdf/mupdf-1.20.0.ebuild1
2 files changed, 21 insertions, 0 deletions
diff --git a/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch b/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch
new file mode 100644
index 00000000000..a975d42d15e
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch
@@ -0,0 +1,20 @@
+--- a/thirdparty/lcms2/src/cmsplugin.c
++++ b/thirdparty/lcms2/src/cmsplugin.c
+@@ -177,7 +177,7 @@ cmsBool CMSEXPORT _cmsReadFloat32Number(cmsContext ContextID, cmsIOHANDLER* io,
+ if (n != NULL) {
+
+ tmp = _cmsAdjustEndianess32(tmp);
+- *n = *(cmsFloat32Number*)(void*)&tmp;
++ *n = (cmsFloat32Number)tmp;
+
+ // Safeguard which covers against absurd values
+ if (*n > 1E+20 || *n < -1E+20) return FALSE;
+@@ -308,7 +308,7 @@ cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsContext ContextID, cmsIOHANDLER* io
+
+ _cmsAssert(io != NULL);
+
+- tmp = *(cmsUInt32Number*) (void*) &n;
++ tmp = (cmsUInt32Number)n;
+ tmp = _cmsAdjustEndianess32(tmp);
+ if (io -> Write(ContextID, io, sizeof(cmsUInt32Number), &tmp) != 1)
+ return FALSE;
diff --git a/app-text/mupdf/mupdf-1.20.0.ebuild b/app-text/mupdf/mupdf-1.20.0.ebuild
index 3d7f8f3e294..216bbfaa79e 100644
--- a/app-text/mupdf/mupdf-1.20.0.ebuild
+++ b/app-text/mupdf/mupdf-1.20.0.ebuild
@@ -51,6 +51,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
# General cross fixes from Debian (refreshed)
"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
+ "${FILESDIR}"/${P}-lcms2.patch
)
src_prepare() {