AZTEC: fix out-of-bounds crash when user-specified size given,

ticket #300, props Andre Maute;
  fix 4-layer compact block max (76 -> 64);
  fix encoding of byte-blocks > 11-bit limit
library: fix 21-bit Unicode conversion in `escape_char_process()`;
  fix restricting escaped data length by using de-escaped length to
  check (`escape_char_process()` adapted to do length only calc
  also)
This commit is contained in:
gitlost
2023-11-23 16:31:44 +00:00
parent 06ae7c1b7a
commit 7c4a538248
9 changed files with 640 additions and 181 deletions

View File

@ -1,7 +1,7 @@
/* aztec.h - Handles Aztec 2D Symbols */
/*
libzint - the open source barcode library
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008-2023 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -104,7 +104,7 @@ static const short AztecSizes[32] = {
};
static const short AztecCompactSizes[4] = {
17, 40, 51, 76
17, 40, 51, 64 /* 64 data blocks (Mode Message max) but 76 altogether */
};
static const short Aztec10DataSizes[32] = {
@ -136,7 +136,7 @@ static const short Aztec50DataSizes[32] = {
};
static const short AztecCompact10DataSizes[4] = {
78, 198, 336, 520
78, 198, 336, 512 /* Max 64 * 8 */
};
static const short AztecCompact23DataSizes[4] = {