diff --git a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp b/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp index 00ba30349..04742e4cf 100644 --- a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp +++ b/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp @@ -156,7 +156,7 @@ void DecodedBitStreamParser::decodeC40Segment(Ref bits, ostringstream // TODO(bbrown): The Upper Shift with C40 doesn't work in the 4 value scenario all the time bool upperShift = false; - int* cValues = new int[3]; + int cValues[3]; int shift = 0; do { // If there is only one byte left then it will be encoded as ASCII @@ -233,7 +233,7 @@ void DecodedBitStreamParser::decodeTextSegment(Ref bits, ostringstrea // TODO(bbrown): The Upper Shift with Text doesn't work in the 4 value scenario all the time bool upperShift = false; - int* cValues = new int[3]; + int cValues[3]; int shift = 0; do { // If there is only one byte left then it will be encoded as ASCII @@ -309,7 +309,7 @@ void DecodedBitStreamParser::decodeAnsiX12Segment(Ref bits, ostringst // Three ANSI X12 values are encoded in a 16-bit value as // (1600 * C1) + (40 * C2) + C3 + 1 - int* cValues = new int[3]; + int cValues[3]; do { // If there is only one byte left then it will be encoded as ASCII if (bits->available() == 8) { @@ -343,7 +343,7 @@ void DecodedBitStreamParser::decodeAnsiX12Segment(Ref bits, ostringst } 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 temp = fullBitValue / 1600; result[0] = temp; diff --git a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h b/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h index 20414c084..5d322a0db 100644 --- a/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h +++ b/cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h @@ -81,7 +81,7 @@ private: */ void decodeBase256Segment(Ref bits, std::ostringstream &result, std::vector 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 */