mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Made sure the BitmapSource subclasses do not reuse a BitArray which is too small.
git-svn-id: https://zxing.googlecode.com/svn/trunk@355 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
ae54d7a937
commit
0b7bface5b
|
@ -52,7 +52,7 @@ final class RGBMonochromeBitmapSource implements MonochromeBitmapSource {
|
|||
}
|
||||
|
||||
public BitArray getBlackRow(int y, BitArray row, int startX, int getWidth) {
|
||||
if (row == null) {
|
||||
if (row == null || row.getSize() < getWidth) {
|
||||
row = new BitArray(getWidth);
|
||||
} else {
|
||||
row.clear();
|
||||
|
|
|
@ -55,7 +55,7 @@ final class RGBMonochromeBitmapSource implements MonochromeBitmapSource {
|
|||
}
|
||||
|
||||
public BitArray getBlackRow(int y, BitArray row, int startX, int getWidth) {
|
||||
if (row == null) {
|
||||
if (row == null || row.getSize() < getWidth) {
|
||||
row = new BitArray(getWidth);
|
||||
} else {
|
||||
row.clear();
|
||||
|
|
|
@ -57,7 +57,7 @@ public final class LCDUIImageMonochromeBitmapSource implements MonochromeBitmapS
|
|||
}
|
||||
|
||||
public BitArray getBlackRow(int y, BitArray row, int startX, int getWidth) {
|
||||
if (row == null) {
|
||||
if (row == null || row.getSize() < getWidth) {
|
||||
row = new BitArray(getWidth);
|
||||
} else {
|
||||
row.clear();
|
||||
|
|
|
@ -109,7 +109,7 @@ public final class BufferedImageMonochromeBitmapSource implements MonochromeBitm
|
|||
}
|
||||
|
||||
public BitArray getBlackRow(int y, BitArray row, int startX, int getWidth) {
|
||||
if (row == null) {
|
||||
if (row == null || row.getSize() < getWidth) {
|
||||
row = new BitArray(getWidth);
|
||||
} else {
|
||||
row.clear();
|
||||
|
|
Loading…
Reference in a new issue