This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 8a1feb3c701596f4a8570ab7f04fa5525550cbfa
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Sun Sep 13 00:37:18 2026 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Mon Sep 14 04:35:12 2026 +0200

    compat/atomics: store pointers through the exchange on MSVC for ARM before 
19.44
    
    The alias analysis of MSVC for ARM and ARM64 before 19.44 does not track
    a pointer that is converted to an integer for the __iso_volatile_store
    and __stlr intrinsics, so the stores initializing the pointed-to object
    are eliminated as dead. Storing the address of an automatic array into
    an atomic pointer and reading through it afterwards then reads
    uninitialized stack. The stdatomic.h of /experimental:c11atomics
    generates the same code, 19.44 is the first version without the bug.
    The interlocked exchange is not affected, and with its result unused it
    compiles to the same store as a plain store would without the bug.
    
    Signed-off-by: Kacper Michajłow <[email protected]>
---
 compat/atomics/stdatomic.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/compat/atomics/stdatomic.h b/compat/atomics/stdatomic.h
index 71bc52c430..12481dcde4 100644
--- a/compat/atomics/stdatomic.h
+++ b/compat/atomics/stdatomic.h
@@ -154,7 +154,17 @@ static av_always_inline void ff_atomic_store_ptr(volatile 
void *object,
                                                  const volatile void *desired,
                                                  memory_order order)
 {
+/* The alias analysis of MSVC for ARM before 19.44 does not track a pointer
+ * converted to an integer for the store intrinsics, so the stores initializing
+ * the pointed-to object are eliminated as dead. The interlocked exchange is 
not
+ * affected, and with its result unused it compiles to the same store as a 
plain
+ * store would without the bug. */
+#if defined(_MSC_VER) && !defined(__clang__) && _MSC_VER < 1944 && \
+    (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC))
+    FF_ATOMIC_SIZE(exchange, sizeof(void *))(object, (uintptr_t)desired, 
order);
+#else
     FF_ATOMIC_SIZE(store, sizeof(void *))(object, (uintptr_t)desired, order);
+#endif
 }
 
 static av_always_inline uintptr_t

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to