if (MEDIA_VISION_ERROR_NONE != err) {
printf("ERROR: Errors were occurred during opening the file!!! code: %i\n", err);
+ if (data_buffer != NULL)
+ destroy_loaded_buffer(data_buffer);
+
MEDIA_VISION_FUNCTION_LEAVE();
return err;
if (MEDIA_VISION_ERROR_NONE != err) {
printf("ERROR: Can't convert to the selected colorspace!!! code: %i\n", err);
+ if (data_buffer != NULL)
+ destroy_loaded_buffer(data_buffer);
+
+ if (converted_buffer)
+ free(converted_buffer);
+
MEDIA_VISION_FUNCTION_LEAVE();
return err;
model.out_buffer_ptr = data_buffer;
- mv_engine_config_h mv_engine_config;
+ mv_engine_config_h mv_engine_config = NULL;
err = mv_create_engine_config(&mv_engine_config);
if (MEDIA_VISION_ERROR_NONE != err)
printf("ERROR: Errors were occurred during creating the media engine config: %i\n", err);
if (MEDIA_VISION_ERROR_NONE != err) {
printf("ERROR: Errors were occurred during creating the source!!! code: %i\n", err);
+ if (data_buffer != NULL)
+ destroy_loaded_buffer(data_buffer);
+
+ if (converted_buffer)
+ free(converted_buffer);
+
+ if (mv_engine_config)
+ mv_destroy_engine_config(mv_engine_config);
+
MEDIA_VISION_FUNCTION_LEAVE();
return err;
if (MEDIA_VISION_ERROR_NONE != err) {
printf("ERROR: Errors were occurred during filling the source!!! code: %i\n", err);
+ if (data_buffer != NULL)
+ destroy_loaded_buffer(data_buffer);
+
+ if (converted_buffer)
+ free(converted_buffer);
+
+ if (mv_engine_config)
+ mv_destroy_engine_config(mv_engine_config);
+
+ mv_destroy_source(source);
MEDIA_VISION_FUNCTION_LEAVE();
return err;
if (data_buffer != NULL)
destroy_loaded_buffer(data_buffer);
- if (MEDIA_VISION_ERROR_NONE != err) {
+ if (MEDIA_VISION_ERROR_NONE != err)
printf("ERROR: Errors were occurred during barcode detection!!! code: %i\n", err);
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return err;
- }
-
err = mv_destroy_source(source);
if (MEDIA_VISION_ERROR_NONE != err)
printf("ERROR: Errors were occurred during destroying the source!!! code: %i\n", err);
PRINT_R("Incorrect input! Try again.");
error = load_mv_source_from_file(path_to_image, source);
+
+ if (path_to_image != NULL)
+ free(path_to_image);
+
if (MEDIA_VISION_ERROR_NONE != error) {
PRINT_E("Errors were occurred during source loading, code %i", error);
return;
}
- if (path_to_image != NULL)
- free(path_to_image);
-
int video_stream_id = 0;
while (input_int("Input video stream identificator (integer value):",