[vlc-devel] [PATCH 2/2] lib: core: Check refcount from the locked scope

Hugo Beauzée-Luyssen hugo at beauzee.fr
Tue Mar 10 10:25:21 CET 2020


---
 lib/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/core.c b/lib/core.c
index 56b985f597..1239173710 100644
--- a/lib/core.c
+++ b/lib/core.c
@@ -74,9 +74,9 @@ error:
 void libvlc_retain( libvlc_instance_t *p_instance )
 {
     assert( p_instance != NULL );
-    assert( p_instance->ref_count < UINT_MAX );
 
     vlc_mutex_lock( &p_instance->instance_lock );
+    assert( p_instance->ref_count < UINT_MAX );
     p_instance->ref_count++;
     vlc_mutex_unlock( &p_instance->instance_lock );
 }
-- 
2.20.1



More information about the vlc-devel mailing list