X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=69917f7fb5d9cfc8dcaf246128f77d93557d7c6d;hp=f33fa3394ec52be5d11c4dd102ffb468025156ca;hb=afe9cd4a86956a4ae2664422a557b9975ff02b00;hpb=5f0b5523775fe5fe8dcc7c232aa831979a36498c diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index f33fa339..69917f7f 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -167,6 +167,9 @@ uint64_t ctf_timestamp_begin(struct trace_descriptor *descriptor, if (!stream_pos->packet_real_index) goto error; + if (stream_pos->packet_real_index->len <= 0) + continue; + if (type == BT_CLOCK_REAL) { index = &g_array_index(stream_pos->packet_real_index, struct packet_index, @@ -225,6 +228,9 @@ uint64_t ctf_timestamp_end(struct trace_descriptor *descriptor, if (!stream_pos->packet_real_index) goto error; + if (stream_pos->packet_real_index->len <= 0) + continue; + if (type == BT_CLOCK_REAL) { index = &g_array_index(stream_pos->packet_real_index, struct packet_index, @@ -1845,6 +1851,9 @@ int ctf_convert_index_timestamp(struct trace_descriptor *tdp) stream_pos->packet_real_index = g_array_new(FALSE, TRUE, sizeof(struct packet_index)); + if (!stream_pos->packet_cycles_index) + continue; + for (k = 0; k < stream_pos->packet_cycles_index->len; k++) { struct packet_index *index; struct packet_index new_index;