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

This commit is contained in:
Clément Bœsch
2014-12-27 22:14:23 +01:00
parent cc91488588
commit 56e432b27b
+1 -1
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;