1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-05-14 10:03:54 +00:00

raster/vector: fix BARCODE_BIND_TOP trumping BARCODE_BOX

backend/tests/fuzz: update "fuzz.h" to take `option_3` min/max;
  update `INPUT_MODE_MASK` & `OUTPUT_OPTIONS_MASK`;
  set `height`, `border_width` & `output_options` from input
  (removing `Z_FUZZ_SET_OUTPUT_OPTIONS` conditional) and call
  `ZBarcode_Encode_and_Print()` instead of `ZBarcode_Encode()`;
  support standalone builds of "fuzz_data" & "fuzz_gs1" with
  `Z_FUZZ_MAIN_READ_ARGV_1` macro;
  update "fuzz_gs1" & "fuzz_gs1.dict" to better test caret/raw
  modes;
  gen_corpora: add `output_options`, `height` & `border_width` &
  find (3rd) from fuzz_data of BIND_TOP | BIND_BOX bug
This commit is contained in:
gitlost
2026-03-22 15:05:53 +00:00
parent f6174cba04
commit 56fca5b2a1
18 changed files with 494 additions and 307 deletions

View File

@@ -727,7 +727,8 @@ static void draw_bind_box(const struct zint_symbol *symbol, unsigned char *pixel
DEFAULT_INK);
}
}
if (symbol->output_options & BARCODE_BOX) {
/* BARCODE_BIND_TOP trumps BARCODE_BOX */
if (!(symbol->output_options & BARCODE_BIND_TOP) && (symbol->output_options & BARCODE_BOX)) {
/* Vertical side bars */
const int xbox_right = image_width - bwidth_si;
int box_top = yoffset_si;