diff --git a/omx/gstomx.c b/omx/gstomx.c index f174e33126..8513a43156 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -722,7 +722,7 @@ gst_omx_component_set_last_error (GstOMXComponent * comp, OMX_ERRORTYPE err) * very beginning and never change again until * component destruction. */ - n = comp->ports->len; + n = (comp->ports ? comp->ports->len : 0); for (i = 0; i < n; i++) { GstOMXPort *tmp = g_ptr_array_index (comp->ports, i);