mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50388
This commit is contained in:
parent
45df470227
commit
7fe6d3c108
|
@ -257,8 +257,10 @@ final class DecodedBitStreamParser {
|
|||
// do not include terminator
|
||||
optionalFieldsLength--;
|
||||
}
|
||||
resultMetadata.setOptionalData(
|
||||
Arrays.copyOfRange(codewords, optionalFieldsStart, optionalFieldsStart + optionalFieldsLength));
|
||||
if (optionalFieldsLength > 0) {
|
||||
resultMetadata.setOptionalData(Arrays.copyOfRange(codewords,
|
||||
optionalFieldsStart, optionalFieldsStart + optionalFieldsLength));
|
||||
}
|
||||
}
|
||||
|
||||
return codeIndex;
|
||||
|
@ -547,14 +549,14 @@ final class DecodedBitStreamParser {
|
|||
int codeIndex,
|
||||
ECIStringBuilder result) throws FormatException {
|
||||
boolean end = false;
|
||||
|
||||
|
||||
while (codeIndex < codewords[0] && !end) {
|
||||
//handle leading ECIs
|
||||
while (codeIndex < codewords[0] && codewords[codeIndex] == ECI_CHARSET) {
|
||||
result.appendECI(codewords[++codeIndex]);
|
||||
codeIndex++;
|
||||
}
|
||||
|
||||
|
||||
if (codeIndex >= codewords[0] || codewords[codeIndex] >= TEXT_COMPACTION_MODE_LATCH) {
|
||||
end = true;
|
||||
} else {
|
||||
|
@ -564,7 +566,7 @@ final class DecodedBitStreamParser {
|
|||
do {
|
||||
value = 900 * value + codewords[codeIndex++];
|
||||
count++;
|
||||
} while (count < 5 &&
|
||||
} while (count < 5 &&
|
||||
codeIndex < codewords[0] &&
|
||||
codewords[codeIndex] < TEXT_COMPACTION_MODE_LATCH);
|
||||
if (count == 5 && (mode == BYTE_COMPACTION_MODE_LATCH_6 ||
|
||||
|
|
Loading…
Reference in a new issue