Ref<FinderPattern> bottomLeft(info->getBottomLeft());\r
\r
float moduleSize = calculateModuleSize(topLeft, topRight, bottomLeft);\r
+ if (moduleSize < 1.0f) {\r
+ throw zxing::ReaderException("bad module size");\r
+ }\r
int dimension = computeDimension(topLeft, topRight, bottomLeft, moduleSize);\r
Version *provisionalVersion = Version::getProvisionalVersionForDimension(dimension);\r
int modulesBetweenFPCenters = provisionalVersion->getDimensionForVersion() - 7;\r
}\r
int alignmentAreaTopY = max(0, estAlignmentY - allowance);\r
int alignmentAreaBottomY = min((int)(image_->getHeight() - 1), estAlignmentY + allowance);\r
+ if (alignmentAreaBottomY - alignmentAreaTopY < overallEstModuleSize * 3) {\r
+ throw zxing::ReaderException("region too small to hold alignment pattern");\r
+ }\r
\r
AlignmentPatternFinder alignmentFinder(image_, alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX\r
- alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, callback_);\r