mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Issue #862 : avoid invalid codeword from bad EC number estimate
This commit is contained in:
parent
9068f64eb5
commit
c89470b2b0
|
@ -244,10 +244,12 @@ public final class PDF417ScanningDecoder {
|
||||||
}
|
}
|
||||||
barcodeMatrix01.setValue(calculatedNumberOfCodewords);
|
barcodeMatrix01.setValue(calculatedNumberOfCodewords);
|
||||||
} else if (numberOfCodewords[0] != calculatedNumberOfCodewords) {
|
} else if (numberOfCodewords[0] != calculatedNumberOfCodewords) {
|
||||||
|
if (calculatedNumberOfCodewords >= 1 && calculatedNumberOfCodewords <= PDF417Common.MAX_CODEWORDS_IN_BARCODE) {
|
||||||
// The calculated one is more reliable as it is derived from the row indicator columns
|
// The calculated one is more reliable as it is derived from the row indicator columns
|
||||||
barcodeMatrix01.setValue(calculatedNumberOfCodewords);
|
barcodeMatrix01.setValue(calculatedNumberOfCodewords);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static DecoderResult createDecoderResult(DetectionResult detectionResult) throws FormatException,
|
private static DecoderResult createDecoderResult(DetectionResult detectionResult) throws FormatException,
|
||||||
ChecksumException, NotFoundException {
|
ChecksumException, NotFoundException {
|
||||||
|
|
Loading…
Reference in a new issue