[vlc-commits] Don't overwrite the LibVLC structure lock with memset()

Rémi Denis-Courmont git at videolan.org
Mon May 30 17:21:04 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon May 30 17:22:57 2011 +0300| [7eb6a150f350e26350da921372cc8af77630d98c] | committer: Rémi Denis-Courmont

Don't overwrite the LibVLC structure lock with memset()

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

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

diff --git a/src/misc/objects.c b/src/misc/objects.c
index fa66349..544ce2e 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -141,6 +141,7 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
     obj->psz_header = NULL;
     obj->b_die = false;
     obj->b_force = false;
+    memset (obj + 1, 0, length - sizeof (*obj)); /* type-specific stuff */
 
     if (likely(parent != NULL))
     {
@@ -179,7 +180,6 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
         vlc_restorecancel (canc);
     }
 
-    memset (obj + 1, 0, length - sizeof (*obj));
     return obj;
 }
 



More information about the vlc-commits mailing list