From cf3391027b7e422dd7b1f9a8678da731273835dc Mon Sep 17 00:00:00 2001 From: Nikos Ftylitakis Date: Thu, 19 Mar 2020 12:17:58 +0200 Subject: [PATCH] add extra check in QRFinderPatternFinder to avoid segmentation. Must be investigated if it is work-around that hides issue or if it is a valid check. #164 --- src/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp b/src/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp index c90308f..42306ad 100644 --- a/src/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp +++ b/src/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp @@ -512,11 +512,16 @@ Ref FinderPatternFinder::find(DecodeHints const& hints) { } } - if(this->possibleCenters_.size() < 3) { + if(possibleCenters_.size() < 3) { throw zxing::ReaderException("no possible centers found"); } vector< Ref > patternInfo = selectBestPatterns(); + + if(patternInfo.size() != 3) { + throw zxing::ReaderException("no pattern info found"); + } + vector< Ref > patternInfoResPoints; for(size_t i=0; i