[vlc-commits] picture_Hold: add an assertion

Rémi Denis-Courmont git at videolan.org
Thu Oct 30 20:02:52 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 30 21:02:43 2014 +0200| [c2b0f25eab8debf0f9d437dbeb298368692dddc6] | committer: Rémi Denis-Courmont

picture_Hold: add an assertion

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

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

diff --git a/src/misc/picture.c b/src/misc/picture.c
index 358de65..6aa5b05 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -284,7 +284,8 @@ picture_t *picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_
 
 picture_t *picture_Hold( picture_t *p_picture )
 {
-    atomic_fetch_add( &p_picture->gc.refcount, 1 );
+    uintptr_t refs = atomic_fetch_add( &p_picture->gc.refcount, 1 );
+    assert( refs > 0 );
     return p_picture;
 }
 



More information about the vlc-commits mailing list