From: Clément Bœsch Date: Mon, 26 May 2014 19:08:32 +0000 (+0200) Subject: avutil/atomic: reuse ret to avoid dereferencing twice the same value. X-Git-Tag: n2.6~1366 X-Git-Url: https://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=56e432b27b8f65872a8b1381bde86b7e54f6a7c7 avutil/atomic: reuse ret to avoid dereferencing twice the same value. --- 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;