[FFmpeg-cvslog] avfilter/dnn_backend_openvino: fix use uninitialized values

Zhao Zhili git at videolan.org
Fri Sep 15 08:38:31 EEST 2023


ffmpeg | branch: master | Zhao Zhili <zhilizhao at tencent.com> | Sat Sep  2 16:23:55 2023 +0800| [e0880ef8cb5f92d1c2acb951477d04cb782a6705] | committer: Guo Yejun

avfilter/dnn_backend_openvino: fix use uninitialized values

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e0880ef8cb5f92d1c2acb951477d04cb782a6705
---

 libavfilter/dnn/dnn_backend_openvino.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 85db4ecd35..7150bf0886 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -1090,37 +1090,37 @@ static int get_output_ov(void *model, const char *input_name, int input_width, i
             status = ov_partial_shape_create(4, dims, &partial_shape);
             if (status != OK) {
                 av_log(ctx, AV_LOG_ERROR, "Failed create partial shape.\n");
-                goto err;
+                return ov2_map_error(status, NULL);
             }
             status = ov_const_port_get_shape(ov_model->input_port, &input_shape);
             input_shape.dims[2] = input_height;
             input_shape.dims[3] = input_width;
             if (status != OK) {
                 av_log(ctx, AV_LOG_ERROR, "Failed create shape for model input resize.\n");
-                goto err;
+                return ov2_map_error(status, NULL);
             }
 
             status = ov_shape_to_partial_shape(input_shape, &partial_shape);
             if (status != OK) {
                 av_log(ctx, AV_LOG_ERROR, "Failed create partial shape for model input resize.\n");
-                goto err;
+                return ov2_map_error(status, NULL);
             }
 
             status = ov_model_reshape_single_input(ov_model->ov_model, partial_shape);
             if (status != OK) {
                 av_log(ctx, AV_LOG_ERROR, "Failed to reszie model input.\n");
-                goto err;
+                return ov2_map_error(status, NULL);
             }
         } else {
             avpriv_report_missing_feature(ctx, "Do not support dynamic model.");
-            goto err;
+            return AVERROR(ENOTSUP);
         }
     }
 
     status = ov_model_const_output_by_name(ov_model->ov_model, output_name, &ov_model->output_port);
     if (status != OK) {
         av_log(ctx, AV_LOG_ERROR, "Failed to get output port.\n");
-        goto err;
+        return ov2_map_error(status, NULL);
     }
     if (!ov_model->compiled_model) {
 #else



More information about the ffmpeg-cvslog mailing list