1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

features2d: fixed out of bounds access in SIFT

This commit is contained in:
Maksim Shabunin
2024-09-13 13:09:54 +03:00
parent 4c81e174bf
commit 6308739638
2 changed files with 38 additions and 24 deletions
+12
View File
@@ -30,5 +30,17 @@ TEST(Features2d_SIFT, descriptor_type)
ASSERT_EQ(countNonZero(diff), 0) << "descriptors are not identical";
}
TEST(Features2d_SIFT, regression_26139)
{
auto extractor = cv::SIFT::create();
cv::Mat1b image{cv::Size{300, 300}, 0};
std::vector<cv::KeyPoint> kps {
cv::KeyPoint(154.076813f, 136.160904f, 111.078636f, 216.195618f, 0.00000899323549f, 7)
};
cv::Mat descriptors;
extractor->compute(image, kps, descriptors); // we expect no memory corruption
ASSERT_EQ(descriptors.size(), Size(128, 1));
}
}} // namespace