diff options
author | Prashant Gotarne <ps.gotarne@samsung.com> | 2015-03-18 16:05:34 +0530 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-07-13 14:16:52 +0100 |
commit | 3cea60dc6f2d7f8641107348c4a6576308e601cc (patch) | |
tree | 514286aff4be2a7fd6482ce2d05b2833efd97e39 | |
parent | ee407305588e4a18cffbd8fd60bffc9b3f03fab4 (diff) |
task: add function guard for _set_lock() and fix guard for _join()
Should only access the object structure after checking
it's valid in gst_task_join().
https://bugzilla.gnome.org/show_bug.cgi?id=746385
https://bugzilla.gnome.org/show_bug.cgi?id=746431
-rw-r--r-- | gst/gsttask.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/gsttask.c b/gst/gsttask.c index 6241bb87b..62453d1d2 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -442,6 +442,8 @@ gst_task_new (GstTaskFunction func, gpointer user_data, GDestroyNotify notify) void gst_task_set_lock (GstTask * task, GRecMutex * mutex) { + g_return_if_fail (GST_IS_TASK (task)); + GST_OBJECT_LOCK (task); if (G_UNLIKELY (task->running)) goto is_running; @@ -797,10 +799,10 @@ gst_task_join (GstTask * task) gpointer id; GstTaskPool *pool = NULL; - priv = task->priv; - g_return_val_if_fail (GST_IS_TASK (task), FALSE); + priv = task->priv; + tself = g_thread_self (); GST_DEBUG_OBJECT (task, "Joining task %p, thread %p", task, tself); |