History

avfilter/dnn_backend_openvino: fix use uninitialized values

Error handling was broken since neither `ret` nor `task` has being initialized on error path.

Zhao Zhili committed 3 years ago

Commit e0880ef1 parent 7cb63291 file · +6 −6Browse files

Unified · Split

libavfilter/dnn/dnn_backend_openvino.c+6−6
@@ -1090,37 +1090,37 @@ static int get_output_ov(void *model, const char *input_name, int input_width, i · 1089 unmodified lines
10901090 status = ov_partial_shape_create(4, dims, &partial_shape);
10911091 if (status != OK) {
10921092 av_log(ctx, AV_LOG_ERROR, "Failed create partial shape.\n");
1093− goto err;
1093+ return ov2_map_error(status, NULL);
10941094 }
10951095 status = ov_const_port_get_shape(ov_model->input_port, &input_shape);
10961096 input_shape.dims[2] = input_height;
10971097 input_shape.dims[3] = input_width;
10981098 if (status != OK) {
10991099 av_log(ctx, AV_LOG_ERROR, "Failed create shape for model input resize.\n");
1100− goto err;
1100+ return ov2_map_error(status, NULL);
11011101 }
11021102
11031103 status = ov_shape_to_partial_shape(input_shape, &partial_shape);
11041104 if (status != OK) {
11051105 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);
11071107 }
11081108
11091109 status = ov_model_reshape_single_input(ov_model->ov_model, partial_shape);
11101110 if (status != OK) {
11111111 av_log(ctx, AV_LOG_ERROR, "Failed to reszie model input.\n");
1112− goto err;
1112+ return ov2_map_error(status, NULL);
11131113 }
11141114 } else {
11151115 avpriv_report_missing_feature(ctx, "Do not support dynamic model.");
1116− goto err;
1116+ return AVERROR(ENOTSUP);
11171117 }
11181118 }
11191119
11201120 status = ov_model_const_output_by_name(ov_model->ov_model, output_name, &ov_model->output_port);
11211121 if (status != OK) {
11221122 av_log(ctx, AV_LOG_ERROR, "Failed to get output port.\n");
1123− goto err;
1123+ return ov2_map_error(status, NULL);
11241124 }
11251125 if (!ov_model->compiled_model) {
11261126 #else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t