mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Avoid exception in weird image situations
git-svn-id: https://zxing.googlecode.com/svn/trunk@1854 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
3b9dccf95f
commit
1c564fcf6a
|
@ -111,7 +111,7 @@ public final class DataMatrixReader implements Reader {
|
||||||
|
|
||||||
int matrixWidth = (right - left + 1) / moduleSize;
|
int matrixWidth = (right - left + 1) / moduleSize;
|
||||||
int matrixHeight = (bottom - top + 1) / moduleSize;
|
int matrixHeight = (bottom - top + 1) / moduleSize;
|
||||||
if (matrixWidth == 0 || matrixHeight == 0) {
|
if (matrixWidth <= 0 || matrixHeight <= 0) {
|
||||||
throw NotFoundException.getNotFoundInstance();
|
throw NotFoundException.getNotFoundInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class QRCodeReader implements Reader {
|
||||||
|
|
||||||
int matrixWidth = (right - left + 1) / moduleSize;
|
int matrixWidth = (right - left + 1) / moduleSize;
|
||||||
int matrixHeight = (bottom - top + 1) / moduleSize;
|
int matrixHeight = (bottom - top + 1) / moduleSize;
|
||||||
if (matrixWidth == 0 || matrixHeight == 0) {
|
if (matrixWidth <= 0 || matrixHeight <= 0) {
|
||||||
throw NotFoundException.getNotFoundInstance();
|
throw NotFoundException.getNotFoundInstance();
|
||||||
}
|
}
|
||||||
if (matrixHeight != matrixWidth) {
|
if (matrixHeight != matrixWidth) {
|
||||||
|
|
Loading…
Reference in a new issue