mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-13 04:13:58 +08:00
Update pptinypose_utils.cc 添加 py 范围限制, 避免 utils::DarkParse 内部出现数组越界
This commit is contained in:
@@ -101,7 +101,7 @@ void GetFinalPredictions(const std::vector<float>& heatmap,
|
|||||||
coords[j * 2 + 1] = idx / heatmap_width;
|
coords[j * 2 + 1] = idx / heatmap_width;
|
||||||
int px = int(coords[j * 2] + 0.5);
|
int px = int(coords[j * 2] + 0.5);
|
||||||
int py = int(coords[j * 2 + 1] + 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);
|
utils::DarkParse(heatmap, dim, &coords, px, py, index, j);
|
||||||
} else {
|
} else {
|
||||||
if (px > 0 && px < heatmap_width - 1) {
|
if (px > 0 && px < heatmap_width - 1) {
|
||||||
|
Reference in New Issue
Block a user