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

Git pushed a commit to branch master
in repository ffmpeg.

commit ccaeb89a643a98717951bbe562fce0f4582b3182
Author:     Niklas Haas <[email protected]>
AuthorDate: Sat Jul 11 12:31:54 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sun Jul 19 10:20:04 2026 +0000

    avformat/shared: use strong CAS for marking PENDING
    
    This was using a weak atomic under the assumption that the `goto retry`
    will immediately jump back to the same line. However, that's no longer
    true after the introduction of the `read_block` label, which we can
    jump to from the error handling fallback path.
    
    In this case, we really ought to use a strong CAS to ensure that we
    only re-check the state if it truly changed in the meantime.
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 libavformat/shared.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/shared.c b/libavformat/shared.c
index c01d7d4e9b..ca33b7ddad 100644
--- a/libavformat/shared.c
+++ b/libavformat/shared.c
@@ -655,10 +655,10 @@ read_block:
     case BLOCK_NONE:
         if (s->read_only)
             break; /* don't mark block as pending */
-        if (atomic_compare_exchange_weak_explicit(&block->state, &state,
-                                                  BLOCK_PENDING,
-                                                  memory_order_acquire,
-                                                  memory_order_acquire))
+        if (atomic_compare_exchange_strong_explicit(&block->state, &state,
+                                                    BLOCK_PENDING,
+                                                    memory_order_acquire,
+                                                    memory_order_acquire))
         {
             /* Acquired pending state, proceed to fetch the block */
             state = BLOCK_PENDING;

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to