diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 6a603e4d00..51226a42e7 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -405,7 +405,10 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) } else { GST_DEBUG_OBJECT (pipeline, "Don't need to update clock, using old clock."); - clock = gst_object_ref (cur_clock); + /* only try to ref if cur_clock is not NULL */ + if (cur_clock) + gst_object_ref (cur_clock); + clock = cur_clock; } if (clock) {