1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #27877 from MaximSmolskiy:fix_QRCodeDetector_detectAndDecode_crash

Fix QRCodeDetector::detectAndDecode crash #27877

### Pull Request Readiness Checklist

Fix #27807 

The problem is that when we find closest points from hull, we can get same closest point for several different points

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Maxim Smolskiy
2025-10-08 08:50:54 +03:00
committed by GitHub
parent b644754226
commit 75598e5377
2 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -470,7 +470,7 @@ TEST(Objdetect_QRCode_basic, not_found_qrcode)
QRCodeDetector qrcode;
EXPECT_FALSE(qrcode.detect(zero_image, corners));
corners = std::vector<Point>(4);
EXPECT_NO_THROW(qrcode.decode(zero_image, corners, straight_barcode));
EXPECT_ANY_THROW(qrcode.decode(zero_image, corners, straight_barcode));
}
TEST(Objdetect_QRCode_detect, detect_regression_21287)