diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ximage/ximagesink.c | 5 | ||||
-rw-r--r-- | sys/xvimage/xvimagesink.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index c6931acd8..e7f489298 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -922,10 +922,13 @@ gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink) XWindowAttributes attr; g_return_if_fail (GST_IS_XIMAGESINK (ximagesink)); - g_return_if_fail (ximagesink->xwindow != NULL); /* Update the window geometry */ g_mutex_lock (ximagesink->x_lock); + if (G_UNLIKELY (ximagesink->xwindow == NULL)) { + g_mutex_unlock (ximagesink->x_lock); + return; + } XGetWindowAttributes (ximagesink->xcontext->disp, ximagesink->xwindow->win, &attr); diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 8298a9a86..f2af4953f 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1048,10 +1048,13 @@ gst_xvimagesink_xwindow_update_geometry (GstXvImageSink * xvimagesink) XWindowAttributes attr; g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink)); - g_return_if_fail (xvimagesink->xwindow != NULL); /* Update the window geometry */ g_mutex_lock (xvimagesink->x_lock); + if (G_UNLIKELY (xvimagesink->xwindow == NULL)) { + g_mutex_unlock (xvimagesink->x_lock); + return; + } XGetWindowAttributes (xvimagesink->xcontext->disp, xvimagesink->xwindow->win, &attr); |