size += gst_tensor_get_element_count (*dim) *
tensor_element_size[split->sink_tensor_conf.info.type];
mem = gst_allocator_alloc (NULL, size, NULL);
- gst_memory_map (mem, &dest_info, GST_MAP_WRITE);
- gst_buffer_map (buffer, &src_info, GST_MAP_READ);
+ g_assert (gst_memory_map (mem, &dest_info, GST_MAP_WRITE));
+ g_assert (gst_buffer_map (buffer, &src_info, GST_MAP_READ));
for (i = 0; i < nth; i++) {
dim = g_array_index (split->tensorseg, tensor_dim *, i);
GstBuffer *buf = gst_buffer_new_allocate (NULL, 10, NULL);
GstMapInfo info;
- gst_buffer_map (buf, &info, GST_MAP_WRITE);
+ if (!gst_buffer_map (buf, &info, GST_MAP_WRITE)) {
+ _print_log ("failed to get mem map");
+ g_test_data.test_failed = failed = TRUE;
+ gst_buffer_unref (buf);
+ goto error;
+ }
+
snprintf ((char *) info.data, 10, "%d", i);
gst_buffer_unmap (buf, &info);
if (gst_app_src_push_buffer (GST_APP_SRC (appsrc), buf) != GST_FLOW_OK) {
_print_log ("failed to push buffer [%d]", i);
g_test_data.test_failed = failed = TRUE;
+ gst_buffer_unref (buf);
goto error;
}
}