From cfd80e95a12cd1f21e2dd76f566c8106e03b8c5d Mon Sep 17 00:00:00 2001 From: ThinkWD <48641295+ThinkWD@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:16:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20#2359=20(#2363)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update pptinypose_utils.cc 添加 py 范围限制, 避免 utils::DarkParse 内部出现数组越界 --- fastdeploy/vision/keypointdet/pptinypose/pptinypose_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastdeploy/vision/keypointdet/pptinypose/pptinypose_utils.cc b/fastdeploy/vision/keypointdet/pptinypose/pptinypose_utils.cc index c0d80a4a6..eb5a1f34f 100644 --- a/fastdeploy/vision/keypointdet/pptinypose/pptinypose_utils.cc +++ b/fastdeploy/vision/keypointdet/pptinypose/pptinypose_utils.cc @@ -101,7 +101,7 @@ void GetFinalPredictions(const std::vector& heatmap, coords[j * 2 + 1] = idx / heatmap_width; int px = int(coords[j * 2] + 0.5); int py = int(coords[j * 2 + 1] + 0.5); - if (DARK && px > 1 && px < heatmap_width - 2) { + if (DARK && px > 1 && px < heatmap_width - 2 && py > 1 && py < heatmap_height - 2) { utils::DarkParse(heatmap, dim, &coords, px, py, index, j); } else { if (px > 0 && px < heatmap_width - 1) {