mirror of
https://git.code.sf.net/p/zint/code
synced 2026-05-14 18:13:53 +00:00
raster/vector: EAN/UPC: fix calculation of image/vector height to
allow for heights smaller than `textoffset` when have add-on (buffer overflow for raster, outside vector height for vector) raster: EAN/UPC: make sure don't overwrite add-on stuff when line-copying guard descenders by limiting copy width ZBarcode_Encode_Segs: allow for multiple (stacked) rows when setting absolute minimum height; state stacked symbols max in error message DBAR_EXP: check length on encoding method 6 before trying to parse 3-digit currency string with `z_to_int()` CLI: stop looping over data args when have error; suppress taint warning by using fixed `malloc()` size for `arg_opts` instead of `argc` general: use `vsnprintf()` instead of `vsprintf()` if not C89 ULTRACODE: don't call `ult_generate_codewords()` if `length` 0 from fragment processing (avoids `assert()`) clang-tidy -> 23 & suppress some warnings test suite: fuzz: leave Z_FUZZ_DEBUG to compiler, fix comment general: some minor code-formatting on touched files README.deb -> README.debian (avoid confusion with actual ".deb") BWIPP: update to latest
This commit is contained in:
@@ -1140,7 +1140,7 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
|
||||
}
|
||||
|
||||
if (symbol->rows >= 200) { /* Check for stacking too many symbols */
|
||||
return error_tag(ZINT_ERROR_TOO_LONG, symbol, 770, "Too many stacked symbols");
|
||||
return error_tag(ZINT_ERROR_TOO_LONG, symbol, 770, "Too many stacked symbols (maximum 200)");
|
||||
}
|
||||
if (symbol->rows < 0) { /* Silently defend against out-of-bounds access */
|
||||
symbol->rows = 0;
|
||||
@@ -1275,8 +1275,9 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
|
||||
}
|
||||
|
||||
if (error_number < ZINT_ERROR) {
|
||||
if (symbol->height < 0.5f) { /* Absolute minimum */
|
||||
(void) z_set_height(symbol, 0.0f, 50.0f, 0.0f, 1 /*no_errtxt*/);
|
||||
const int rows = symbol->rows ? symbol->rows : 1;
|
||||
if (symbol->height < 0.5f * rows) { /* Absolute minimum */
|
||||
(void) z_set_height(symbol, 0.0f, 50.0f * rows, 0.0f, 1 /*no_errtxt*/);
|
||||
}
|
||||
assert(!(symbol->output_options & BARCODE_CONTENT_SEGS)
|
||||
|| (symbol->content_segs && symbol->content_seg_count && symbol->content_segs[0].source
|
||||
|
||||
Reference in New Issue
Block a user