[vlc-devel] commit: Some objects have no name. Fix segmentation fault. ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jan 23 17:34:32 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jan 23 18:32:38 2010 +0200| [4041e2678462848af2331f05468f21f1700cbb1e] | committer: Rémi Denis-Courmont 

Some objects have no name. Fix segmentation fault.

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

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

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 1ac347d..0e92c92 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -884,7 +884,8 @@ static vlc_object_t *FindParentName (vlc_object_t *p_this, const char *name)
          parent != NULL;
          parent = parent->p_parent)
     {
-        if (!strcmp (vlc_internals (parent)->psz_name, name))
+        const char *objname = vlc_internals (parent)->psz_name;
+        if (objname && !strcmp (objname, name))
             return vlc_object_hold (parent);
     }
     return NULL;
@@ -909,7 +910,7 @@ static vlc_object_t *FindChildName (vlc_object_internals_t *priv,
 {
     for (priv = priv->first; priv != NULL; priv = priv->next)
     {
-        if (!strcmp (priv->psz_name, name))
+        if (priv->psz_name && !strcmp (priv->psz_name, name))
             return vlc_object_hold (vlc_externals (priv));
 
         vlc_object_t *found = FindChildName (priv, name);




More information about the vlc-devel mailing list