mirror of
https://git.code.sf.net/p/zint/code
synced 2026-01-28 22:36:02 +00:00
general: prefix all INTERNAL funcs/tables with zint_, except
those in "backend/common.h", which are prefixed by `z_` - makes symbol clashes more unlikely when zint is statically linked (ticket #337, props Ulrich Becker) DOTCODE: fix padding allowance (10 -> 52 - probable max 35) to cover cases with large no. of columns requested and little data, to prevent `codeword_array` buffer overflow AZTEC/CODEONE: some code fiddling general_field: prefix defines with `GF_`, shorten static funcs prefix `general_field_` -> `gf_`
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* tif_lzw.h - LZW compression for TIFF */
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2021-2024 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2021-2025 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -168,10 +168,10 @@ static void tif_lzw_cl_hash(tif_lzw_state *sp) {
|
||||
#define PutNextCode(op_fmp, c) { \
|
||||
nextdata = (nextdata << nbits) | c; \
|
||||
nextbits += nbits; \
|
||||
fm_putc((nextdata >> (nextbits - 8)) & 0xff, op_fmp); \
|
||||
zint_fm_putc((nextdata >> (nextbits - 8)) & 0xff, op_fmp); \
|
||||
nextbits -= 8; \
|
||||
if (nextbits >= 8) { \
|
||||
fm_putc((nextdata >> (nextbits - 8)) & 0xff, op_fmp); \
|
||||
zint_fm_putc((nextdata >> (nextbits - 8)) & 0xff, op_fmp); \
|
||||
nextbits -= 8; \
|
||||
} \
|
||||
outcount += nbits; \
|
||||
@@ -358,7 +358,7 @@ static int tif_lzw_encode(tif_lzw_state *sp, struct filemem *op_fmp, const unsig
|
||||
PutNextCode(op_fmp, CODE_EOI);
|
||||
/* Explicit 0xff masking to make icc -check=conversions happy */
|
||||
if (nextbits > 0) {
|
||||
fm_putc((nextdata << (8 - nextbits)) & 0xff, op_fmp);
|
||||
zint_fm_putc((nextdata << (8 - nextbits)) & 0xff, op_fmp);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user