Skip to content

Commit

Permalink
修复 #2359 (#2363)
Browse files Browse the repository at this point in the history
Update pptinypose_utils.cc

添加 py 范围限制, 避免 utils::DarkParse 内部出现数组越界
  • Loading branch information
ThinkWD committed Jan 29, 2024
1 parent cfebd24 commit cfd80e9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void GetFinalPredictions(const std::vector<float>& 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) {
Expand Down

0 comments on commit cfd80e9

Please sign in to comment.