diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index d1780fcf51..99ad35b350 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -1779,6 +1779,13 @@ gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, ximagesink = GST_XIMAGESINK (bsink); + if (G_UNLIKELY (!caps)) { + GST_WARNING_OBJECT (ximagesink, "have no caps, doing fallback allocation"); + *buf = NULL; + ret = GST_FLOW_OK; + goto beach; + } + /* This shouldn't really happen because state changes will fail * if the xcontext can't be allocated */ if (!ximagesink->xcontext) diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 51b2d9cf4e..30368d51f0 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -2508,6 +2508,9 @@ gst_xvimagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, xvimagesink = GST_XVIMAGESINK (bsink); + if (G_UNLIKELY (!caps)) + goto no_caps; + g_mutex_lock (xvimagesink->pool_lock); if (G_UNLIKELY (xvimagesink->pool_invalid)) goto invalid; @@ -2701,6 +2704,13 @@ invalid_caps: g_mutex_unlock (xvimagesink->pool_lock); goto beach; } +no_caps: + { + GST_WARNING_OBJECT (xvimagesink, "have no caps, doing fallback allocation"); + *buf = NULL; + ret = GST_FLOW_OK; + goto beach; + } } /* Interfaces stuff */