From 0abfce11afbda4106ccd89378adabe6c1c7d7f7d Mon Sep 17 00:00:00 2001 From: Christopher Schwartz Date: Fri, 10 Jan 2025 11:48:43 +0100 Subject: [PATCH 1/2] Fix issue with atomic_compare_exchange_strong due to inappropriate type on 32 bit platforms Signed-off-by: Christopher Schwartz --- src/lib/OpenEXRCore/chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/OpenEXRCore/chunk.c b/src/lib/OpenEXRCore/chunk.c index 99a2b8bf54..f14cb27c83 100644 --- a/src/lib/OpenEXRCore/chunk.c +++ b/src/lib/OpenEXRCore/chunk.c @@ -565,7 +565,7 @@ extract_chunk_table ( if (ctable == NULL) { int64_t nread = 0; - uintptr_t eptr = 0, nptr = 0; + uint64_t eptr = 0, nptr = 0; int complete = 1; uint64_t maxoff = ((uint64_t) -1); exr_result_t rv; From 6e8e640fc164c8af7f4f60ac7021d4d3e13d60b8 Mon Sep 17 00:00:00 2001 From: Christopher Schwartz Date: Thu, 13 Feb 2025 09:03:30 +0100 Subject: [PATCH 2/2] Change casted type to match the type of the assigned to variable on both, 32 and 64 bit platforms Signed-off-by: Christopher Schwartz --- src/lib/OpenEXRCore/chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/OpenEXRCore/chunk.c b/src/lib/OpenEXRCore/chunk.c index f14cb27c83..ec3ed7777b 100644 --- a/src/lib/OpenEXRCore/chunk.c +++ b/src/lib/OpenEXRCore/chunk.c @@ -639,7 +639,7 @@ extract_chunk_table ( } else { priv_to_native64 (ctable, part->chunk_count); } - nptr = (uintptr_t) ctable; + nptr = (uint64_t) ctable; // see if we win or not if (!atomic_compare_exchange_strong ( EXR_CONST_CAST (atomic_uintptr_t*, &(part->chunk_table)),