mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Issue 1326 DM memory leaks
git-svn-id: https://zxing.googlecode.com/svn/trunk@2417 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
cf52d70528
commit
6c2c27cb39
|
@ -156,7 +156,7 @@ void DecodedBitStreamParser::decodeC40Segment(Ref<BitSource> bits, ostringstream
|
||||||
// TODO(bbrown): The Upper Shift with C40 doesn't work in the 4 value scenario all the time
|
// TODO(bbrown): The Upper Shift with C40 doesn't work in the 4 value scenario all the time
|
||||||
bool upperShift = false;
|
bool upperShift = false;
|
||||||
|
|
||||||
int* cValues = new int[3];
|
int cValues[3];
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
do {
|
do {
|
||||||
// If there is only one byte left then it will be encoded as ASCII
|
// If there is only one byte left then it will be encoded as ASCII
|
||||||
|
@ -233,7 +233,7 @@ void DecodedBitStreamParser::decodeTextSegment(Ref<BitSource> bits, ostringstrea
|
||||||
// TODO(bbrown): The Upper Shift with Text doesn't work in the 4 value scenario all the time
|
// TODO(bbrown): The Upper Shift with Text doesn't work in the 4 value scenario all the time
|
||||||
bool upperShift = false;
|
bool upperShift = false;
|
||||||
|
|
||||||
int* cValues = new int[3];
|
int cValues[3];
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
do {
|
do {
|
||||||
// If there is only one byte left then it will be encoded as ASCII
|
// If there is only one byte left then it will be encoded as ASCII
|
||||||
|
@ -309,7 +309,7 @@ void DecodedBitStreamParser::decodeAnsiX12Segment(Ref<BitSource> bits, ostringst
|
||||||
// Three ANSI X12 values are encoded in a 16-bit value as
|
// Three ANSI X12 values are encoded in a 16-bit value as
|
||||||
// (1600 * C1) + (40 * C2) + C3 + 1
|
// (1600 * C1) + (40 * C2) + C3 + 1
|
||||||
|
|
||||||
int* cValues = new int[3];
|
int cValues[3];
|
||||||
do {
|
do {
|
||||||
// If there is only one byte left then it will be encoded as ASCII
|
// If there is only one byte left then it will be encoded as ASCII
|
||||||
if (bits->available() == 8) {
|
if (bits->available() == 8) {
|
||||||
|
@ -343,7 +343,7 @@ void DecodedBitStreamParser::decodeAnsiX12Segment(Ref<BitSource> bits, ostringst
|
||||||
} while (bits->available() > 0);
|
} while (bits->available() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DecodedBitStreamParser::parseTwoBytes(int firstByte, int secondByte, int*& result) {
|
void DecodedBitStreamParser::parseTwoBytes(int firstByte, int secondByte, int* result) {
|
||||||
int fullBitValue = (firstByte << 8) + secondByte - 1;
|
int fullBitValue = (firstByte << 8) + secondByte - 1;
|
||||||
int temp = fullBitValue / 1600;
|
int temp = fullBitValue / 1600;
|
||||||
result[0] = temp;
|
result[0] = temp;
|
||||||
|
|
|
@ -81,7 +81,7 @@ private:
|
||||||
*/
|
*/
|
||||||
void decodeBase256Segment(Ref<BitSource> bits, std::ostringstream &result, std::vector<unsigned char> byteSegments);
|
void decodeBase256Segment(Ref<BitSource> bits, std::ostringstream &result, std::vector<unsigned char> byteSegments);
|
||||||
|
|
||||||
void parseTwoBytes(int firstByte, int secondByte, int*& result);
|
void parseTwoBytes(int firstByte, int secondByte, int* result);
|
||||||
/**
|
/**
|
||||||
* See ISO 16022:2006, Annex B, B.2
|
* See ISO 16022:2006, Annex B, B.2
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue