Remove of unnecessary bytes array

This commit is contained in:
SebGDev 2015-01-21 10:47:47 +01:00
parent f44fe7b6d2
commit f082e12bc5

View File

@ -399,16 +399,15 @@ void DecodedBitStreamParser::decodeBase256Segment(Ref<BitSource> bits, ostringst
throw FormatException("NegativeArraySizeException"); throw FormatException("NegativeArraySizeException");
} }
ArrayRef<char> bytes(count);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
// Have seen this particular error in the wild, such as at // Have seen this particular error in the wild, such as at
// http://www.bcgen.com/demo/IDAutomationStreamingDataMatrix.aspx?MODE=3&D=Fred&PFMT=3&PT=F&X=0.3&O=0&LM=0.2 // http://www.bcgen.com/demo/IDAutomationStreamingDataMatrix.aspx?MODE=3&D=Fred&PFMT=3&PT=F&X=0.3&O=0&LM=0.2
if (bits->available() < 8) { if (bits->available() < 8) {
throw FormatException("byteSegments"); throw FormatException("byteSegments");
} }
bytes[i] = unrandomize255State(bits->readBits(8), codewordPosition++); char byte = unrandomize255State(bits->readBits(8), codewordPosition++);
byteSegments.push_back(bytes[i]); byteSegments.push_back(byte);
result << (char)bytes[i]; result << byte;
} }
} }
} }