diff --git a/core/src/com/google/zxing/aztec/detector/Detector.java b/core/src/com/google/zxing/aztec/detector/Detector.java index 4464a8837..fc4403760 100644 --- a/core/src/com/google/zxing/aztec/detector/Detector.java +++ b/core/src/com/google/zxing/aztec/detector/Detector.java @@ -84,6 +84,10 @@ public final class Detector { * @throws NotFoundException in case of too many errors or invalid parameters */ private void extractParameters(ResultPoint[] bullsEyeCorners) throws NotFoundException { + if (!isValid(bullsEyeCorners[0]) || !isValid(bullsEyeCorners[1]) || + !isValid(bullsEyeCorners[2]) || !isValid(bullsEyeCorners[3])) { + throw NotFoundException.getNotFoundInstance(); + } int twoCenterLayers = 2 * nbCenterLayers; // Get the bits around the bull's eye boolean[] resab = sampleLine(bullsEyeCorners[0], bullsEyeCorners[1], twoCenterLayers+1); @@ -560,9 +564,6 @@ public final class Detector { ResultPoint result1 = new ResultPoint(centerx + ratio * dx, centery + ratio * dy); ResultPoint result3 = new ResultPoint(centerx - ratio * dx, centery - ratio * dy); - if (!isValid(result0) || !isValid(result1) || !isValid(result2) || !isValid(result3)) { - throw NotFoundException.getNotFoundInstance(); - } return new ResultPoint[] { result0, result1, result2, result3 }; } diff --git a/core/test/data/blackbox/aztec-1/hello.png b/core/test/data/blackbox/aztec-1/hello.png new file mode 100644 index 000000000..c720da88c Binary files /dev/null and b/core/test/data/blackbox/aztec-1/hello.png differ diff --git a/core/test/data/blackbox/aztec-1/hello.txt b/core/test/data/blackbox/aztec-1/hello.txt new file mode 100644 index 000000000..b6fc4c620 --- /dev/null +++ b/core/test/data/blackbox/aztec-1/hello.txt @@ -0,0 +1 @@ +hello \ No newline at end of file diff --git a/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java b/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java index 0645e2500..465366f2c 100644 --- a/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java +++ b/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java @@ -26,10 +26,10 @@ public final class AztecBlackBox1TestCase extends AbstractBlackBoxTestCase { public AztecBlackBox1TestCase() { super("test/data/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC); - addTest(11, 11, 0.0f); - addTest(11, 11, 90.0f); - addTest(11, 11, 180.0f); - addTest(11, 11, 270.0f); + addTest(12, 12, 0.0f); + addTest(12, 12, 90.0f); + addTest(12, 12, 180.0f); + addTest(12, 12, 270.0f); } } \ No newline at end of file