From patchwork Sun Jun 13 14:43:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 28261 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp2112562iol; Sun, 13 Jun 2021 07:56:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2sdvgoMbjWwJ4gBqv0O9o3uPSlteiGq2iwNqbSN4bN0yN32Vh/K04JidKcT9ExAMFfwY7 X-Received: by 2002:a17:906:f111:: with SMTP id gv17mr11568977ejb.435.1623596205470; Sun, 13 Jun 2021 07:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623596205; cv=none; d=google.com; s=arc-20160816; b=o1T1qzeEhjEdENU7FZXvEnhVBofSHDhbXCOFe4L0IjB8X0eImytP7YBEnJO4vjVM2c ZO1+amFMNNUOV5Bv0LeRSIl4WLisguE7XT4zZGo8G42uWNtKSHgBUMyXwDlKUToa7Ugs SCGzU9n+tlP2mjbqONs8fIrT5QVsupCDj2ILhyzbE2pitujPVHMUlbqV0kSBZPDTehEz C21U2pLwGvnZl8XC1/7069Q3+KXIYjjJISoWXhF20Pi0Hk5bGS1Icj8SEmhAY/S2ULQH OLsPQHYRe6HCgG5qH3cTjaK2v9/5oTlAPige5JGhTdEcNMIQcqYWGJUa568l1eu3f1IZ 1Zrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:ironport-sdr :ironport-sdr:delivered-to; bh=5aWnnLUZAiOxJ8/KnYGkbF325WkhCOquyc/814js9Rw=; b=M79amDWlbOcFZjxelSIdkkx6qZZBZbBaB59NO4TTjUM67LjGEj9f9r5WzL4HjIJ+l8 1X27yiBZSaLf2evq9QsLTXHXqBDx74Q2crJSnibrvLuzSFLqXRYR4TTKiASkh5UA28kI STOoYdxK7YNVLdGN1qrCw6fYyQE3BlnDZ8iYcvyMUZiuQAAcrEfjdDrnua3PtcHjgvlv hFswgDJGQpB28zzYf8AFJDegyPYAcMqgd02GaaqwwzQUKy0Xd97a3laZqRlQ2Z3bIkfR FGOMDJtPloeTwvH4oF61/divuK6BuJYNzKCRvbBv+mldhShhWXxtP+Zb1OVLKSkmksyZ MVZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id jv9si9508302ejc.70.2021.06.13.07.56.44; Sun, 13 Jun 2021 07:56:45 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3FD08687FB2; Sun, 13 Jun 2021 17:56:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 99353680297 for ; Sun, 13 Jun 2021 17:56:32 +0300 (EEST) IronPort-SDR: hmV1n7tl/b3co9JL4SI3ASY4Hy/pu5JEcDlvjTNMOQBpdxCV27OSyF1bhVxMUvLDXPknMZ5zf3 PVpcvE48m6dw== X-IronPort-AV: E=McAfee;i="6200,9189,10014"; a="202697740" X-IronPort-AV: E=Sophos;i="5.83,271,1616482800"; d="scan'208";a="202697740" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2021 07:56:30 -0700 IronPort-SDR: bSFoM7pFHwahJXK62XFP/8DImJT1tNSbi1oZQmp7I3WiaOry0I5byL/aWCk7dbKvGDDym0bhKT vo1Vm2hzGPHw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,271,1616482800"; d="scan'208";a="487132925" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.44.146]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2021 07:56:29 -0700 From: Guo Yejun To: ffmpeg-devel@ffmpeg.org Date: Sun, 13 Jun 2021 22:43:04 +0800 Message-Id: <20210613144304.3258-1-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] lavfi/dnn_backend_openvino.c: fix crash when target is not specified X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: yejun.guo@intel.com MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3d/Fh5TTzLhI --- libavfilter/dnn/dnn_backend_openvino.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c index 709a772a4d..dee0a8e047 100644 --- a/libavfilter/dnn/dnn_backend_openvino.c +++ b/libavfilter/dnn/dnn_backend_openvino.c @@ -596,8 +596,10 @@ static DNNReturnType extract_inference_from_task(DNNFunctionType func_type, Task InferenceItem *inference; const AVDetectionBBox *bbox = av_get_detection_bbox(header, i); - if (av_strncasecmp(bbox->detect_label, params->target, sizeof(bbox->detect_label)) != 0) { - continue; + if (params->target) { + if (av_strncasecmp(bbox->detect_label, params->target, sizeof(bbox->detect_label)) != 0) { + continue; + } } inference = av_malloc(sizeof(*inference));