mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-22 10:59:01 +00:00
Try to avoid memory issues
This commit is contained in:
parent
d9552dfc34
commit
51ee3fb7c7
@ -16,6 +16,8 @@
|
||||
|
||||
package ext.plantuml.com.google.zxing.common;
|
||||
|
||||
import ext.plantuml.com.google.zxing.WriterException;
|
||||
|
||||
/**
|
||||
* <p>A simple, fast array of bits, represented compactly by an array of ints internally.</p>
|
||||
*
|
||||
@ -230,7 +232,10 @@ public final class BitArray {
|
||||
}
|
||||
|
||||
private static int[] makeArray(int size) {
|
||||
return new int[(size + 31) >> 5];
|
||||
final int tmp = (size + 31) >> 5;
|
||||
if (tmp>1000)
|
||||
throw new IllegalArgumentException("Memory error");
|
||||
return new int[tmp];
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
@ -56,6 +56,7 @@ public class FlashCodeUtilsZxing implements FlashCodeUtils {
|
||||
if (USE_FLASH == false) {
|
||||
return null;
|
||||
}
|
||||
synchronized (FlashCodeUtilsZxing.class) {
|
||||
try {
|
||||
final QRCodeWriter writer = new QRCodeWriter();
|
||||
final Hashtable hints = new Hashtable();
|
||||
@ -70,5 +71,6 @@ public class FlashCodeUtilsZxing implements FlashCodeUtils {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user