X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=src%2Fplugins%2Futils%2Fmuxer%2Fmuxer.c;h=9510d07a5e45a865d33f7855fbdc02534f384268;hb=3625612b8d1f68582f54f4113e375fdf5c66fc09;hp=e68c372c0addaa43615c152abbe894a785af702b;hpb=824cfbd81e2eb6594a6c83e4dd25f53aff36f759;p=babeltrace.git diff --git a/src/plugins/utils/muxer/muxer.c b/src/plugins/utils/muxer/muxer.c index e68c372c..9510d07a 100644 --- a/src/plugins/utils/muxer/muxer.c +++ b/src/plugins/utils/muxer/muxer.c @@ -1531,8 +1531,14 @@ bt_component_class_message_iterator_seek_beginning_method_status muxer_msg_iter_ muxer_msg_iter->ended_muxer_upstream_msg_iters->pdata[i] = NULL; } - g_ptr_array_remove_range(muxer_msg_iter->ended_muxer_upstream_msg_iters, - 0, muxer_msg_iter->ended_muxer_upstream_msg_iters->len); + /* + * GLib < 2.48.0 asserts when g_ptr_array_remove_range() is + * called on an empty array. + */ + if (muxer_msg_iter->ended_muxer_upstream_msg_iters->len > 0) { + g_ptr_array_remove_range(muxer_msg_iter->ended_muxer_upstream_msg_iters, + 0, muxer_msg_iter->ended_muxer_upstream_msg_iters->len); + } muxer_msg_iter->last_returned_ts_ns = INT64_MIN; muxer_msg_iter->clock_class_expectation = MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_ANY;