aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2014-05-26 21:08:32 +0200
committerClément Bœsch <u@pkh.me>2014-12-27 22:14:23 +0100
commit56e432b27b8f65872a8b1381bde86b7e54f6a7c7 (patch)
tree7fd533bfeba78f5015728f11d6cc9369f55f5da3
parentcc91488588acc81766c3f2d644d649ece5a4166e (diff)
downloadffmpeg-56e432b27b8f65872a8b1381bde86b7e54f6a7c7.tar.gz
avutil/atomic: reuse ret to avoid dereferencing twice the same value.
-rw-r--r--libavutil/atomic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/atomic.c b/libavutil/atomic.c
index 1fa6308630..b13725d14f 100644
--- a/libavutil/atomic.c
+++ b/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;