]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/dnn_backend_openvino.c: only allow DFT_PROCESS_FRAME to get output dim
authorGuo, Yejun <yejun.guo@intel.com>
Mon, 15 Mar 2021 08:42:27 +0000 (16:42 +0800)
committerGuo, Yejun <yejun.guo@intel.com>
Thu, 8 Apr 2021 01:23:02 +0000 (09:23 +0800)
libavfilter/dnn/dnn_backend_openvino.c

index 9a47d74c1505f682f46b6c692fc7d21fd8b5458b..66845fbd510562d09e5b3422431345d21c872c01 100644 (file)
@@ -493,6 +493,11 @@ static DNNReturnType get_output_ov(void *model, const char *input_name, int inpu
     IEStatusCode status;
     input_shapes_t input_shapes;
 
+    if (ov_model->model->func_type != DFT_PROCESS_FRAME) {
+        av_log(ctx, AV_LOG_ERROR, "Get output dim only when processing frame.\n");
+        return DNN_ERROR;
+    }
+
     if (ctx->options.input_resizable) {
         status = ie_network_get_input_shapes(ov_model->network, &input_shapes);
         input_shapes.shapes->shape.dims[2] = input_height;