mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Possible fix for obscure corner case in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37868
This commit is contained in:
parent
fc2f1c9b0f
commit
aa58f2ec30
|
@ -249,6 +249,9 @@ public final class Code128Writer extends OneDimensionalCodeWriter {
|
|||
static boolean[] produceResult(Collection<int[]> patterns, int checkSum) {
|
||||
// Compute and append checksum
|
||||
checkSum %= 103;
|
||||
if (checkSum < 0) {
|
||||
throw new IllegalArgumentException("Unable to compute a valid input checksum");
|
||||
}
|
||||
patterns.add(Code128Reader.CODE_PATTERNS[checkSum]);
|
||||
|
||||
// Append stop code
|
||||
|
|
Loading…
Reference in a new issue