From 095b27a4b2d56e101d23513671d45099b5a9e78b Mon Sep 17 00:00:00 2001 From: favoritas37 Date: Sun, 14 Jun 2015 13:57:27 +0300 Subject: [PATCH] fix to the toBytes at initial check. --- source/zxing/zxing/common/BitArray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/zxing/zxing/common/BitArray.cpp b/source/zxing/zxing/common/BitArray.cpp index 5c3c3c0..9330462 100644 --- a/source/zxing/zxing/common/BitArray.cpp +++ b/source/zxing/zxing/common/BitArray.cpp @@ -206,8 +206,8 @@ void BitArray::xor_(const BitArray& other) void BitArray::toBytes(int bitOffset, std::vector& array, int offset, int numBytes) { - if(array.size() < numBytes) - array.resize(numBytes); + if(array.size() < (numBytes + offset)) + array.resize(numBytes + offset); for (int i = 0; i < numBytes; i++) { int theByte = 0;