mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Calculate addresses correctly if last TIFF strip is full
This commit is contained in:
parent
ec8cfcbb76
commit
f4852b11a8
@ -94,7 +94,11 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
if (i != (strip_count - 1)) {
|
if (i != (strip_count - 1)) {
|
||||||
strip_bytes[i] = rows_per_strip * symbol->bitmap_width * 3;
|
strip_bytes[i] = rows_per_strip * symbol->bitmap_width * 3;
|
||||||
} else {
|
} else {
|
||||||
strip_bytes[i] = (symbol->bitmap_height % rows_per_strip) * symbol->bitmap_width * 3;
|
if ((symbol->bitmap_height % rows_per_strip) != 0) {
|
||||||
|
strip_bytes[i] = (symbol->bitmap_height % rows_per_strip) * symbol->bitmap_width * 3;
|
||||||
|
} else {
|
||||||
|
strip_bytes[i] = rows_per_strip * symbol->bitmap_width * 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
free_memory += strip_bytes[i];
|
free_memory += strip_bytes[i];
|
||||||
if ((free_memory % 2) == 1) {
|
if ((free_memory % 2) == 1) {
|
||||||
@ -102,8 +106,6 @@ int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Mem%d\n", free_memory);
|
|
||||||
|
|
||||||
if (free_memory > 0xffff0000) {
|
if (free_memory > 0xffff0000) {
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
free(strip_offset);
|
free(strip_offset);
|
||||||
|
Loading…
Reference in New Issue
Block a user