Error handling was broken since neither `ret` nor `task` has being initialized on error path.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -1090,37 +1090,37 @@ static int get_output_ov(void *model, const char *input_name, int input_width, i · 1089 unmodified lines | ||
| 1090 | 1090 | status = ov_partial_shape_create(4, dims, &partial_shape); |
| 1091 | 1091 | if (status != OK) { |
| 1092 | 1092 | av_log(ctx, AV_LOG_ERROR, "Failed create partial shape.\n"); |
| 1093 | − goto err; | |
| 1093 | + return ov2_map_error(status, NULL); | |
| 1094 | 1094 | } |
| 1095 | 1095 | status = ov_const_port_get_shape(ov_model->input_port, &input_shape); |
| 1096 | 1096 | input_shape.dims[2] = input_height; |
| 1097 | 1097 | input_shape.dims[3] = input_width; |
| 1098 | 1098 | if (status != OK) { |
| 1099 | 1099 | av_log(ctx, AV_LOG_ERROR, "Failed create shape for model input resize.\n"); |
| 1100 | − goto err; | |
| 1100 | + return ov2_map_error(status, NULL); | |
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | status = ov_shape_to_partial_shape(input_shape, &partial_shape); |
| 1104 | 1104 | if (status != OK) { |
| 1105 | 1105 | av_log(ctx, AV_LOG_ERROR, "Failed create partial shape for model input resize.\n"); |
| 1106 | − goto err; | |
| 1106 | + return ov2_map_error(status, NULL); | |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | status = ov_model_reshape_single_input(ov_model->ov_model, partial_shape); |
| 1110 | 1110 | if (status != OK) { |
| 1111 | 1111 | av_log(ctx, AV_LOG_ERROR, "Failed to reszie model input.\n"); |
| 1112 | − goto err; | |
| 1112 | + return ov2_map_error(status, NULL); | |
| 1113 | 1113 | } |
| 1114 | 1114 | } else { |
| 1115 | 1115 | avpriv_report_missing_feature(ctx, "Do not support dynamic model."); |
| 1116 | − goto err; | |
| 1116 | + return AVERROR(ENOTSUP); | |
| 1117 | 1117 | } |
| 1118 | 1118 | } |
| 1119 | 1119 | |
| 1120 | 1120 | status = ov_model_const_output_by_name(ov_model->ov_model, output_name, &ov_model->output_port); |
| 1121 | 1121 | if (status != OK) { |
| 1122 | 1122 | av_log(ctx, AV_LOG_ERROR, "Failed to get output port.\n"); |
| 1123 | − goto err; | |
| 1123 | + return ov2_map_error(status, NULL); | |
| 1124 | 1124 | } |
| 1125 | 1125 | if (!ov_model->compiled_model) { |
| 1126 | 1126 | #else |