mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 19:57:27 -08:00
Closes #610 : avoid AIOOBE in pure-barcode mode for obviously wrong case
This commit is contained in:
parent
5927f6ef09
commit
1a5b739cdc
|
@ -139,6 +139,10 @@ public class QRCodeReader implements Reader {
|
|||
// Special case, where bottom-right module wasn't black so we found something else in the last row
|
||||
// Assume it's a square, so use height as the width
|
||||
right = left + (bottom - top);
|
||||
if (right >= image.getWidth()) {
|
||||
// Abort if that would not make sense -- off image
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
}
|
||||
|
||||
int matrixWidth = Math.round((right - left + 1) / moduleSize);
|
||||
|
|
Loading…
Reference in a new issue