gl: check null before unref GstGLDisplay

This commit is contained in:
Wang Xin-yu (王昕宇) 2014-08-20 09:37:01 +08:00 committed by Tim-Philipp Müller
parent ac2fdb0aed
commit c8d1e4ad5f

View file

@ -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;