mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avutil/atomic: reuse ret to avoid dereferencing twice the same value.
This commit is contained in:
parent
cc91488588
commit
56e432b27b
@ -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…
Reference in New Issue
Block a user