X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;fp=formats%2Fctf%2Fctf.c;h=0cf799cd224f1d35978d7268675032294ece52f1;hp=e626c6cf872c2fb094dbfaebf4a46197a8356372;hb=024ffe47266b6e162873fb6df08ad0e560194986;hpb=27f3cedc640465e8fb0f073d023833821a258b15 diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index e626c6cf..0cf799cd 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -951,6 +951,11 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence) assert(0); } + if (pos->cur_index >= pos->packet_index->len) { + pos->offset = EOF; + return; + } + packet_index = &g_array_index(pos->packet_index, struct packet_index, pos->cur_index); if (pos->cur_index > 0) { @@ -963,11 +968,6 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence) ctf_update_current_packet_index(&file_stream->parent, prev_index, packet_index); - if (pos->cur_index >= pos->packet_index->len) { - pos->offset = EOF; - return; - } - /* * We need to check if we are in trace read or called * from packet indexing. In this last case, the