From e4924f2c34ab7e61660278a194551b47c3bc7401 Mon Sep 17 00:00:00 2001 From: Mathis Rosenhauer Date: Tue, 20 Nov 2012 17:27:28 +0100 Subject: [PATCH] Only copy options actually set --- src/sz_compat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sz_compat.c b/src/sz_compat.c index fdb07b8..4afe6ed 100644 --- a/src/sz_compat.c +++ b/src/sz_compat.c @@ -18,7 +18,8 @@ static int convert_options(int sz_opts) co[SZ_NN_OPTION_MASK] = AEC_DATA_PREPROCESS; for (i = 1; i < NOPTS; i <<= 1) - opts |= co[i]; + if (sz_opts & i) + opts |= co[i]; return opts; } @@ -101,7 +102,7 @@ static size_t remove_padding(void *buf, size_t total, j -= padding_size; memcpy((char *)buf + j, (char *)buf + i, pixel_size); } - if ((i % (line_size + padding_size)) == 0) + if (i % (line_size + padding_size) == 0) j -= padding_size; return j; } -- 2.7.4