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

This commit is contained in:
Nikos Ftylitakis 2020-03-19 12:17:58 +02:00
parent ee750faad0
commit cf3391027b
1 changed files with 6 additions and 1 deletions

View File

@ -512,11 +512,16 @@ Ref<FinderPatternInfo> FinderPatternFinder::find(DecodeHints const& hints) {
}
}
if(this->possibleCenters_.size() < 3) {
if(possibleCenters_.size() < 3) {
throw zxing::ReaderException("no possible centers found");
}
vector< Ref <FinderPattern> > patternInfo = selectBestPatterns();
if(patternInfo.size() != 3) {
throw zxing::ReaderException("no pattern info found");
}
vector< Ref <ResultPoint> > patternInfoResPoints;
for(size_t i=0; i<patternInfo.size(); i++)