Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -225,6 +225,7 @@ static int fill_model_input_ov(OVModel *ov_model, OVRequestItem *request) · 224 unmodified lines | ||
| 225 | 225 | status = ov_port_get_element_type(ov_model->input_port, &precision); |
| 226 | 226 | if (status != OK) { |
| 227 | 227 | av_log(ctx, AV_LOG_ERROR, "Failed to get input port data type.\n"); |
| 228 | + ov_shape_free(&input_shape); | |
| 228 | 229 | return ov2_map_error(status, NULL); |
| 229 | 230 | } |
| 230 | 231 | } else { |
| @@ -236,8 +237,10 @@ static int fill_model_input_ov(OVModel *ov_model, OVRequestItem *request) · 5 unmodified lines | ||
| 236 | 237 | input.channels = dims[1]; |
| 237 | 238 | input.dt = precision_to_datatype(precision); |
| 238 | 239 | input.data = av_malloc(input.height * input.width * input.channels * get_datatype_size(input.dt)); |
| 239 | − if (!input.data) | |
| 240 | + if (!input.data) { | |
| 241 | + ov_shape_free(&input_shape); | |
| 240 | 242 | return AVERROR(ENOMEM); |
| 243 | + } | |
| 241 | 244 | input_data_ptr = input.data; |
| 242 | 245 | #else |
| 243 | 246 | status = ie_infer_request_get_blob(request->infer_request, task->input_name, &input_blob); |
| @@ -300,6 +303,7 @@ static int fill_model_input_ov(OVModel *ov_model, OVRequestItem *request) · 56 unmodified lines | ||
| 300 | 303 | } |
| 301 | 304 | #if HAVE_OPENVINO2 |
| 302 | 305 | status = ov_tensor_create_from_host_ptr(precision, input_shape, input.data, &tensor); |
| 306 | + ov_shape_free(&input_shape); | |
| 303 | 307 | if (status != OK) { |
| 304 | 308 | av_log(ctx, AV_LOG_ERROR, "Failed to create tensor from host prt.\n"); |
| 305 | 309 | return ov2_map_error(status, NULL); |
| @@ -362,12 +366,14 @@ static void infer_completion_callback(void *args) · 56 unmodified lines | ||
| 362 | 366 | status = ov_port_get_element_type(ov_model->output_port, &precision); |
| 363 | 367 | if (status != OK) { |
| 364 | 368 | av_log(ctx, AV_LOG_ERROR, "Failed to get output port data type.\n"); |
| 369 | + ov_shape_free(&output_shape); | |
| 365 | 370 | return; |
| 366 | 371 | } |
| 367 | 372 | output.channels = dims[1]; |
| 368 | 373 | output.height = dims[2]; |
| 369 | 374 | output.width = dims[3]; |
| 370 | 375 | av_assert0(request->lltask_count <= dims[0]); |
| 376 | + ov_shape_free(&output_shape); | |
| 371 | 377 | #else |
| 372 | 378 | IEStatusCode status; |
| 373 | 379 | dimensions_t dims; |