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

Showing the changes to libavfilter (1 of 1 file). Show all

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
1090 status = ov_partial_shape_create(4, dims, &partial_shape);1090 status = ov_partial_shape_create(4, dims, &partial_shape);
1091 if (status != OK) {1091 if (status != OK) {
1092 av_log(ctx, AV_LOG_ERROR, "Failed create partial shape.\n");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 status = ov_const_port_get_shape(ov_model->input_port, &input_shape);1095 status = ov_const_port_get_shape(ov_model->input_port, &input_shape);
1096 input_shape.dims[2] = input_height;1096 input_shape.dims[2] = input_height;
1097 input_shape.dims[3] = input_width;1097 input_shape.dims[3] = input_width;
1098 if (status != OK) {1098 if (status != OK) {
1099 av_log(ctx, AV_LOG_ERROR, "Failed create shape for model input resize.\n");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 status = ov_shape_to_partial_shape(input_shape, &partial_shape);1103 status = ov_shape_to_partial_shape(input_shape, &partial_shape);
1104 if (status != OK) {1104 if (status != OK) {
1105 av_log(ctx, AV_LOG_ERROR, "Failed create partial shape for model input resize.\n");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 status = ov_model_reshape_single_input(ov_model->ov_model, partial_shape);1109 status = ov_model_reshape_single_input(ov_model->ov_model, partial_shape);
1110 if (status != OK) {1110 if (status != OK) {
1111 av_log(ctx, AV_LOG_ERROR, "Failed to reszie model input.\n");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 } else {1114 } else {
1115 avpriv_report_missing_feature(ctx, "Do not support dynamic model.");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 status = ov_model_const_output_by_name(ov_model->ov_model, output_name, &ov_model->output_port);1120 status = ov_model_const_output_by_name(ov_model->ov_model, output_name, &ov_model->output_port);
1121 if (status != OK) {1121 if (status != OK) {
1122 av_log(ctx, AV_LOG_ERROR, "Failed to get output port.\n");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 if (!ov_model->compiled_model) {1125 if (!ov_model->compiled_model) {
1126#else1126#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