[vlc-devel] commit: Assert that allocate object size makes sense ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Mar 29 12:55:32 CET 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Sat Mar 29 13:55:49 2008 +0200| [a9d773c1af2d3f021b4aa371d30d0a5f30369af2]

Assert that allocate object size makes sense

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

 src/misc/objects.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index e16faeb..211a2ca 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -112,6 +112,7 @@ void *vlc_custom_create( vlc_object_t *p_this, size_t i_size,
     }
     else
     {
+        assert (i_size >= sizeof (vlc_object_t));
         p_priv = calloc( 1, sizeof( *p_priv ) + i_size );
         if( p_priv == NULL )
             return NULL;




More information about the vlc-devel mailing list