raster.c: fix possible blank rows appearing in CODE16K, CODE49, PHARMA_TWO,

PDF417 & CODABLOCKF due to height/scale rounding by changing
  out_large_bar_height() to return scaled int values for raster,
  props codemonkey82 (#204)
raster/vector.c: const some vars
vector.c: rect_count, last_start_row UPC/EAN only
library.c: check for stacking symbols >= 200
This commit is contained in:
gitlost 2021-11-07 00:21:02 +00:00
parent 4e72a541f7
commit f7ad0ed1e3
10 changed files with 1291 additions and 1044 deletions

View file

@ -908,6 +908,10 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "768: Border width out of range (0 to 100)");
}
if (symbol->rows >= 200) { /* Check for stacking too many symbols */
return error_tag(symbol, ZINT_ERROR_TOO_LONG, "770: Too many stacked symbols");
}
if ((symbol->input_mode & 0x07) > 2) {
symbol->input_mode = DATA_MODE; /* Reset completely TODO: in future, warn/error */
}