Check for too many codewords after remainder in 144x144 symbols

Bug report and patch by brunt, ticket #42
This commit is contained in:
Robin Stuart 2016-11-25 20:50:35 +00:00
parent 886e789090
commit 658cdd7a69

View File

@ -1193,6 +1193,11 @@ int data_matrix_200(struct zint_symbol *symbol, const unsigned char source[], co
// Now we know the symbol size we can handle the remaining data in the process buffer. // Now we know the symbol size we can handle the remaining data in the process buffer.
symbols_left = matrixbytes[symbolsize] - binlen; symbols_left = matrixbytes[symbolsize] - binlen;
binlen = dm200encode_remainder(binary, binlen, source, inputlen, last_mode, process_buffer, process_p, symbols_left); binlen = dm200encode_remainder(binary, binlen, source, inputlen, last_mode, process_buffer, process_p, symbols_left);
if (binlen > matrixbytes[symbolsize]) {
strcpy(symbol->errtxt, "Data too long to fit in symbol (E12A)");
return ZINT_ERROR_TOO_LONG;
}
H = matrixH[symbolsize]; H = matrixH[symbolsize];
W = matrixW[symbolsize]; W = matrixW[symbolsize];