summaryrefslogtreecommitdiff
path: root/media-libs/kvazaar/files
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/kvazaar/files')
-rw-r--r--media-libs/kvazaar/files/kvazaar-2.3.0-backport-c6f2ba4.patch31
-rw-r--r--media-libs/kvazaar/files/kvazaar-2.3.0-backport-pr392.patch36
2 files changed, 67 insertions, 0 deletions
diff --git a/media-libs/kvazaar/files/kvazaar-2.3.0-backport-c6f2ba4.patch b/media-libs/kvazaar/files/kvazaar-2.3.0-backport-c6f2ba4.patch
new file mode 100644
index 000000000000..c66c413cfc15
--- /dev/null
+++ b/media-libs/kvazaar/files/kvazaar-2.3.0-backport-c6f2ba4.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/902217
+https://github.com/ultravideo/kvazaar/issues/391
+https://github.com/ultravideo/kvazaar/commit/c6f2ba4711d42285636da97b133a7b5aa49c9533
+
+From c6f2ba4711d42285636da97b133a7b5aa49c9533 Mon Sep 17 00:00:00 2001
+From: Joose Sainio <joose.sainio@tuni.fi>
+Date: Thu, 1 Feb 2024 10:47:16 +0200
+Subject: [PATCH] fix unaligned access on array_checksum_generic8
+
+---
+ src/strategies/generic/nal-generic.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/strategies/generic/nal-generic.c b/src/strategies/generic/nal-generic.c
+index 1762c8ba..075c8264 100644
+--- a/src/strategies/generic/nal-generic.c
++++ b/src/strategies/generic/nal-generic.c
+@@ -157,6 +157,13 @@ static void array_checksum_generic8(const kvz_pixel* data,
+ assert(SEI_HASH_MAX_LENGTH >= 4);
+
+ for (y = 0; y < height; ++y) {
++ if (y*stride % 8 != 0) {
++ for (x = 0; x < width; ++x) {
++ uint8_t mask = (uint8_t)((x & 0xff) ^ (y & 0xff) ^ (x >> 8) ^ (y >> 8));
++ checksum += (data[(y * stride) + x] & 0xff) ^ mask;
++ }
++ continue;
++ }
+ for (xp = 0; xp < width/8; ++xp) {
+ const int x = xp * 8;
+ const uint64_t mask = ckmap[(xp&31)+32*(y&255)] ^ ((uint64_t)((x >> 8) ^ (y >> 8)) * 0x101010101010101);
diff --git a/media-libs/kvazaar/files/kvazaar-2.3.0-backport-pr392.patch b/media-libs/kvazaar/files/kvazaar-2.3.0-backport-pr392.patch
new file mode 100644
index 000000000000..81ee9fdca4d9
--- /dev/null
+++ b/media-libs/kvazaar/files/kvazaar-2.3.0-backport-pr392.patch
@@ -0,0 +1,36 @@
+https://bugs.gentoo.org/902217
+https://github.com/ultravideo/kvazaar/pull/392
+
+From b10fc25cb980e1dbab8f42c38280f57765f93a37 Mon Sep 17 00:00:00 2001
+From: matoro <matoro@users.noreply.github.com>
+Date: Thu, 1 Feb 2024 18:35:23 -0500
+Subject: [PATCH] Ignore "*get_pc_thunk.*" symbols in exported symbols test
+
+On i386 (32-bit x86) and sparc, gcc generates references to these
+functions which load the current PC into the specified register. These
+references are then resolved at link-time. Examples of what these
+symbols look like:
+
+../src/.libs/libkvazaar.a:libkvazaar_la-cfg.o:00000000 T __x86.get_pc_thunk.ax
+../src/.libs/libkvazaar.a:libkvazaar_la-cabac.o:0000000000000000 W __sparc_get_pc_thunk.l7
+
+Since these are platform symbols inserted by the toolchain, ignore them.
+The regex is specified as tightly as possible, and based on a quick
+search these appear to be the only two platforms affected.
+---
+ tests/test_external_symbols.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_external_symbols.sh b/tests/test_external_symbols.sh
+index b9b3d5957..4983078bf 100755
+--- a/tests/test_external_symbols.sh
++++ b/tests/test_external_symbols.sh
+@@ -4,7 +4,7 @@
+
+ set -eu${BASH+o pipefail}
+
+-if nm -go --defined-only ../src/.libs/libkvazaar.a | grep -v ' kvz_'; then
++if nm -go --defined-only ../src/.libs/libkvazaar.a | grep -Ev ' (kvz_|__[a-z0-9]+(_|\.)get_pc_thunk\.)'; then
+ printf '%s\n' 'Only symbols prefixed with "kvz_" should be exported from libkvazaar.'
+ false
+ fi