Skip to content

Commit cfd80e9

Browse files
authored
修复 #2359 (#2363)
Update pptinypose_utils.cc 添加 py 范围限制, 避免 utils::DarkParse 内部出现数组越界
1 parent cfebd24 commit cfd80e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fastdeploy/vision/keypointdet/pptinypose/pptinypose_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void GetFinalPredictions(const std::vector<float>& heatmap,
101101
coords[j * 2 + 1] = idx / heatmap_width;
102102
int px = int(coords[j * 2] + 0.5);
103103
int py = int(coords[j * 2 + 1] + 0.5);
104-
if (DARK && px > 1 && px < heatmap_width - 2) {
104+
if (DARK && px > 1 && px < heatmap_width - 2 && py > 1 && py < heatmap_height - 2) {
105105
utils::DarkParse(heatmap, dim, &coords, px, py, index, j);
106106
} else {
107107
if (px > 0 && px < heatmap_width - 1) {

0 commit comments

Comments
 (0)