mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 19:57:27 -08:00
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:
parent
96e0bdb392
commit
e6c6c298e5
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue