[vlc-commits] picture: assert that there is a destroy callback

Rémi Denis-Courmont git at videolan.org
Sun Jul 14 21:44:16 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 14 22:20:08 2013 +0300| [e376480839eb8eba43fe558c314f9484ddd7879e] | committer: Rémi Denis-Courmont

picture: assert that there is a destroy callback

Pictures without destroy callback are allocated on the stack and never
explicitly released.

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

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

diff --git a/src/misc/picture.c b/src/misc/picture.c
index 628bf7b..017670c1 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -289,8 +289,8 @@ void picture_Release( picture_t *p_picture )
         return;
 
     PictureDestroyContext( p_picture );
-    if( p_picture->gc.pf_destroy != NULL )
-        p_picture->gc.pf_destroy( p_picture );
+    assert( p_picture->gc.pf_destroy != NULL );
+    p_picture->gc.pf_destroy( p_picture );
 }
 
 bool picture_IsReferenced( picture_t *p_picture )



More information about the vlc-commits mailing list