Browse Source

avutil/atomic: reuse ret to avoid dereferencing twice the same value.

tags/n2.6
Clément Bœsch 11 years ago
parent
commit
56e432b27b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/atomic.c

+ 1
- 1
libavutil/atomic.c View File

@@ -64,7 +64,7 @@ void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval)
void *ret;
pthread_mutex_lock(&atomic_lock);
ret = *ptr;
if (*ptr == oldval)
if (ret == oldval)
*ptr = newval;
pthread_mutex_unlock(&atomic_lock);
return ret;


Loading…
Cancel
Save