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:
dswitkin 2008-04-10 20:57:37 +00:00
parent ae54d7a937
commit 0b7bface5b
4 changed files with 4 additions and 4 deletions

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();