summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sz_compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sz_compat.c b/src/sz_compat.c
index caa8582..10f9232 100644
--- a/src/sz_compat.c
+++ b/src/sz_compat.c
@@ -151,7 +151,7 @@ int SZ_BufftoBuffCompress(void *dest, size_t *destLen,
pixel_size = bits_to_bytes(strm.bits_per_sample);
if (pad_scanline) {
- scanlines = (sourceLen + param->pixels_per_scanline - 1)
+ scanlines = (sourceLen / pixel_size + param->pixels_per_scanline - 1)
/ param->pixels_per_scanline;
padbuf_size = strm.rsi * strm.block_size * pixel_size * scanlines;
padbuf = malloc(padbuf_size);