*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#include <babeltrace/babeltrace.h>
int i, stream_id;
gpointer *event_id_ptr;
unsigned long event_id;
- struct trace_collection *tc = iter->parent.ctx->tc;
+ struct trace_collection *tc;
+
+ if (!iter || !callback)
+ return -EINVAL;
+ tc = iter->parent.ctx->tc;
for (i = 0; i < tc->array->len; i++) {
struct ctf_trace *tin;
struct trace_descriptor *td_read;
enum bt_cb_ret ret;
struct bt_ctf_event ctf_data;
+ assert(iter && stream);
+
ret = extract_ctf_stream_event(stream, &ctf_data);
+ if (ret)
+ goto end;
/* process all events callback first */
if (iter->main_callbacks.callback) {