From fd23640001495bfb8529466a14c930211cc1809a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 19 Jul 2012 13:20:27 +0200 Subject: [PATCH] miniobject: refuse write when object is shared In all cases, refuse to write an object when it is shared by more than one object (also when the object was locked before). See https://bugzilla.gnome.org/show_bug.cgi?id=679145 --- gst/gstminiobject.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/gstminiobject.c b/gst/gstminiobject.c index be319b1945..a4c42b1b19 100644 --- a/gst/gstminiobject.c +++ b/gst/gstminiobject.c @@ -190,10 +190,11 @@ gst_mini_object_lock (GstMiniObject * object, GstLockFlags flags) } if (access_mode) { + /* shared counter > 1 and write access is not allowed */ + if (state > SHARE_ONE && access_mode & GST_LOCK_FLAG_WRITE) + goto lock_failed; + if ((state & LOCK_FLAG_MASK) == 0) { - /* shared counter > 1 and write access */ - if (state > SHARE_ONE && access_mode & GST_LOCK_FLAG_WRITE) - goto lock_failed; /* nothing mapped, set access_mode */ newstate |= access_mode; } else {