summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Isorce <j.isorce@samsung.com>2016-11-30 09:22:17 +0000
committerJulien Isorce <j.isorce@samsung.com>2016-12-01 10:50:05 +0000
commit119955bea4acd1660b6a2403c956b686ac0d2d14 (patch)
tree489b1475d9debebb0ce7a59b9cefb7b853669215
parentc03a4829acf6ef5cf8fa2f272a87212a1c8ab539 (diff)
downloadgstreamer-plugins-bad-119955bea4acd1660b6a2403c956b686ac0d2d14.tar.gz
gstglcontext: is_shared should return FALSE if no group
If a sub class of GstGLContext does not create a group then it currently crashes: 0 g_atomic_int_get (&share->refcount) 1 _context_share_group_is_shared (context->priv->sharegroup) 2 gst_gl_context_is_shared 3 _default_set_sync_gl https://bugzilla.gnome.org/show_bug.cgi?id=774518
-rw-r--r--gst-libs/gst/gl/gstglcontext.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c
index 899c121c5..792aac726 100644
--- a/gst-libs/gst/gl/gstglcontext.c
+++ b/gst-libs/gst/gl/gstglcontext.c
@@ -1670,6 +1670,10 @@ gboolean
gst_gl_context_is_shared (GstGLContext * context)
{
g_return_val_if_fail (GST_IS_GL_CONTEXT (context), FALSE);
+
+ if (!context->priv->sharegroup)
+ return FALSE;
+
if (GST_IS_GL_WRAPPED_CONTEXT (context))
g_return_val_if_fail (context->priv->active_thread, FALSE);
else