diff options
| author | jmestwa-coder <jmestwa@gmail.com> | 2026-06-15 14:28:28 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-15 14:28:28 +0300 |
| commit | 9e83371612c717c9bfce8eb2625a7c434ea6a717 (patch) | |
| tree | 442d95fbe40e748467034515ca4a6e610872c7b6 /core/src/test/java/com | |
| parent | 36539a1c8eef40c75866016bc3366f036629ece3 (diff) | |
| download | zxing-9e83371612c717c9bfce8eb2625a7c434ea6a717.tar.xz | |
avoid NegativeArraySizeException in aztec getEncodedData (#2091)
Diffstat (limited to 'core/src/test/java/com')
| -rw-r--r-- | core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java b/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java index e7cafa229..7ccf1cfb6 100644 --- a/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java +++ b/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java @@ -64,6 +64,13 @@ public final class DecoderTest extends Assert { } @Test + public void testHighLevelDecodeShortInput() throws FormatException { + // fewer than 5 corrected bits decode to nothing and must not throw NegativeArraySizeException + assertEquals("", Decoder.highLevelDecode(new boolean[0])); + assertEquals("", Decoder.highLevelDecode(new boolean[1])); + } + + @Test public void testAztecResult() throws FormatException { BitMatrix matrix = BitMatrix.parse( "X X X X X X X X X X X X X X \n" + |
