]> git.sesse.net Git - vlc/commitdiff
vlc_object_create: assert that the object type is known
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 28 Jun 2008 18:34:42 +0000 (21:34 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 28 Jun 2008 18:34:42 +0000 (21:34 +0300)
src/misc/objects.c

index fd9e4135fea45a897d54c85b07810973f0461122..ab63e8fc0e00953fe8eb68788e1eed452ed2fae6 100644 (file)
@@ -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;