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
This commit is contained in:
Julien Isorce 2016-11-30 09:22:17 +00:00 committed by Tim-Philipp Müller
parent bf7b608728
commit 22e78529dd

View file

@ -1670,6 +1670,10 @@ gboolean
gst_gl_context_is_shared (GstGLContext * context) gst_gl_context_is_shared (GstGLContext * context)
{ {
g_return_val_if_fail (GST_IS_GL_CONTEXT (context), FALSE); g_return_val_if_fail (GST_IS_GL_CONTEXT (context), FALSE);
if (!context->priv->sharegroup)
return FALSE;
if (GST_IS_GL_WRAPPED_CONTEXT (context)) if (GST_IS_GL_WRAPPED_CONTEXT (context))
g_return_val_if_fail (context->priv->active_thread, FALSE); g_return_val_if_fail (context->priv->active_thread, FALSE);
else else