[vlc-commits] renderer_discovery: Ensure we don't double release items

Hugo Beauzée-Luyssen git at videolan.org
Mon Jul 17 17:30:03 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jul 17 14:36:30 2017 +0200| [53cd851c9957e3d0741f650e8c07389e0dff31a0] | committer: Hugo Beauzée-Luyssen

renderer_discovery: Ensure we don't double release items

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=53cd851c9957e3d0741f650e8c07389e0dff31a0
---

 src/misc/renderer_discovery.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/misc/renderer_discovery.c b/src/misc/renderer_discovery.c
index f2255c5122..0417ab1246 100644
--- a/src/misc/renderer_discovery.c
+++ b/src/misc/renderer_discovery.c
@@ -168,7 +168,9 @@ vlc_renderer_item_release(vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
-    if (atomic_fetch_sub(&p_item->refs, 1) != 1)
+    int refs = atomic_fetch_sub(&p_item->refs, 1);
+    assert(refs != 0 );
+    if( refs != 1 )
         return;
     item_free(p_item);
 }



More information about the vlc-commits mailing list