From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 38D924674A for ; Mon, 17 Jul 2023 05:33:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 67B9268C4CF; Mon, 17 Jul 2023 08:33:12 +0300 (EEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A123868C366 for ; Mon, 17 Jul 2023 08:33:05 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689571990; x=1721107990; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=KleVLBU7sbuRrVPaIVJlc4BTMY8DEDZWIUsBvp66I2Y=; b=BBH/yr4Tgw2DvG+GCHdhcZKyOgalBBPBcn2rsgOC0RsVuX6ThSbtg3gG LGlxwk+60sceXYKaWbbWUU3ptBBAC7zSlCzQ8sIYPdjiKTjK0f6C0rgc3 nEloqW6AqdZboKeO6kUHCgAxSvg2GotM07tgUn9jqxYWrKQWZoqGy0Xnf QCvwcVjsx+fQiWf6lai7Rm6Heqm+K5ri2y/dO0A3HudCbEn6PKmU9fYyO Bo1haik/I0ZI7rSwn4GuAT1RpKV8zyKSZ07Dj6BdSD4EywVrmV2gYv7QR JO1hMp+rI01q6hac+qJZpi+uhHh22V8Bl76nC2tO5H+fhS+9qwfVZddvz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="369398477" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="369398477" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2023 22:33:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="969732918" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="969732918" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.156.43]) by fmsmga006.fm.intel.com with ESMTP; 16 Jul 2023 22:33:02 -0700 From: wenbin.chen-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jul 2023 13:33:01 +0800 Message-Id: <20230717053301.2389494-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavfilter/vf_dnn_detect: bbox index may bigger than bbox number 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Wenbin Chen Fix a bug that queried bbox index may bigger than bbox's total number. Signed-off-by: Wenbin Chen --- libavfilter/vf_dnn_detect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c index 06efce02a6..6ef04e0958 100644 --- a/libavfilter/vf_dnn_detect.c +++ b/libavfilter/vf_dnn_detect.c @@ -106,12 +106,11 @@ static int dnn_detect_post_proc_ov(AVFrame *frame, DNNData *output, AVFilterCont float x1 = detections[i * detect_size + 5]; float y1 = detections[i * detect_size + 6]; - bbox = av_get_detection_bbox(header, i); - if (conf < conf_threshold) { continue; } + bbox = av_get_detection_bbox(header, header->nb_bboxes - nb_bboxes); bbox->x = (int)(x0 * frame->width); bbox->w = (int)(x1 * frame->width) - bbox->x; bbox->y = (int)(y0 * frame->height); -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".