Fix: import index containing only a header
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 7 Feb 2014 16:12:58 +0000 (11:12 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Feb 2014 16:55:19 +0000 (11:55 -0500)
If the index file is present, we have to make sure we imported at least
one index before using the stream_class.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ctf.c

index 122b708f6e74fdfb0b6b6241442c96aca4eb9a39..afc2aefae97c3aab8f0e81d94cf982c09b4ff9da 100644 (file)
@@ -1886,6 +1886,12 @@ int import_stream_packet_index(struct ctf_trace *td,
                g_array_append_val(file_stream->pos.packet_cycles_index, index);
        }
 
+       /* Index containing only the header. */
+       if (!file_stream->parent.stream_class) {
+               ret = -1;
+               goto error;
+       }
+
        ret = 0;
 
 error:
This page took 0.026133 seconds and 4 git commands to generate.