mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Optimization for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39707
This commit is contained in:
parent
b51346c072
commit
af7831b5c7
|
@ -410,20 +410,12 @@ public final class HighLevelEncoder {
|
|||
* @return the requested character count
|
||||
*/
|
||||
public static int determineConsecutiveDigitCount(CharSequence msg, int startpos) {
|
||||
int count = 0;
|
||||
int len = msg.length();
|
||||
int idx = startpos;
|
||||
if (idx < len) {
|
||||
char ch = msg.charAt(idx);
|
||||
while (isDigit(ch) && idx < len) {
|
||||
count++;
|
||||
while (idx < len && isDigit(msg.charAt(idx))) {
|
||||
idx++;
|
||||
if (idx < len) {
|
||||
ch = msg.charAt(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
return idx - startpos;
|
||||
}
|
||||
|
||||
static void illegalCharacter(char c) {
|
||||
|
|
Loading…
Reference in a new issue