diff --git a/core/src/com/google/zxing/qrcode/QRCodeReader.java b/core/src/com/google/zxing/qrcode/QRCodeReader.java index eb394df61..a073b2612 100644 --- a/core/src/com/google/zxing/qrcode/QRCodeReader.java +++ b/core/src/com/google/zxing/qrcode/QRCodeReader.java @@ -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