mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00: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