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

pull/101/head
Clément Bœsch 11 years ago
parent cc91488588
commit 56e432b27b
  1. 2
      libavutil/atomic.c

@ -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