Issue 1138 reject image with nonsensical right-bottom black pixel in pure barcode mode

git-svn-id: https://zxing.googlecode.com/svn/trunk@2679 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen@gmail.com 2013-04-22 13:44:25 +00:00
parent 96e0bdb392
commit e6c6c298e5

View file

@ -118,6 +118,11 @@ public class QRCodeReader implements Reader {
int bottom = rightBottomBlack[1];
int left = leftTopBlack[0];
int right = rightBottomBlack[0];
// Sanity check!
if (left >= right || top >= bottom) {
throw NotFoundException.getNotFoundInstance();
}
if (bottom - top != right - left) {
// Special case, where bottom-right module wasn't black so we found something else in the last row