[vlc-devel] commit: vlc_object_create: assert that the object type is known ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jun 28 20:34:16 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jun 28 21:34:42 2008 +0300| [166dc5d2b4e0856b8a0a8b54821561117f4fb42b]

vlc_object_create: assert that the object type is known

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

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

diff --git a/src/misc/objects.c b/src/misc/objects.c
index fd9e413..ab63e8f 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -263,8 +263,8 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
             psz_type = "announce";
             break;
         default:
-            i_size = i_type > (int)sizeof(vlc_object_t)
-                         ? i_type : (int)sizeof(vlc_object_t);
+            assert( i_type > 0 ); /* unknown type?! */
+            i_size = i_type;
             i_type = VLC_OBJECT_GENERIC;
             psz_type = "generic";
             break;




More information about the vlc-devel mailing list