From: George Kiagiadakis Date: Wed, 12 Mar 2014 11:54:44 +0000 (+0200) Subject: waylandsink: fix crash in case there is no pool because of a caps negotiation error X-Git-Tag: 1.19.3~507^2~10833 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de15c214130962b3afd44d3f394201e1596ee0f9;p=platform%2Fupstream%2Fgstreamer.git waylandsink: fix crash in case there is no pool because of a caps negotiation error --- diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index bba630b..f3b8593 100644 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -206,8 +206,10 @@ gst_wayland_sink_finalize (GObject * object) gst_buffer_unref (sink->last_buffer); if (sink->display) { /* see comment about this call in gst_wayland_sink_change_state() */ - gst_wayland_compositor_release_all_buffers (GST_WAYLAND_BUFFER_POOL - (sink->pool)); + if (sink->pool) { + gst_wayland_compositor_release_all_buffers (GST_WAYLAND_BUFFER_POOL + (sink->pool)); + } g_object_unref (sink->display); } if (sink->window) @@ -258,8 +260,10 @@ gst_wayland_sink_change_state (GstElement * element, GstStateChange transition) * unref the pool and therefore the display, which will try to * stop the thread from within itself and cause a deadlock. */ - gst_wayland_compositor_release_all_buffers (GST_WAYLAND_BUFFER_POOL - (sink->pool)); + if (sink->pool) { + gst_wayland_compositor_release_all_buffers (GST_WAYLAND_BUFFER_POOL + (sink->pool)); + } gst_buffer_replace (&sink->last_buffer, NULL); g_clear_object (&sink->window); g_clear_object (&sink->display);