From c8d1e4ad5f221e1228bc4cbb7e1ac65589f315fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wang=20Xin-yu=20=28=E7=8E=8B=E6=98=95=E5=AE=87=29?= Date: Wed, 20 Aug 2014 09:37:01 +0800 Subject: [PATCH] gl: check null before unref GstGLDisplay --- gst-libs/gst/gl/gstglutils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 2e1b0dd4cf..c2ea06fab2 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -770,7 +770,9 @@ gst_gl_handle_set_context (GstElement * element, GstContext * context, if (replacement) { GstGLDisplay *old = *display; *display = replacement; - gst_object_unref (old); + + if (old) + gst_object_unref (old); } return TRUE;