summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5Znbit.c8
-rw-r--r--src/H5Zscaleoffset.c4
-rw-r--r--src/H5Zszip.c4
3 files changed, 10 insertions, 6 deletions
diff --git a/src/H5Znbit.c b/src/H5Znbit.c
index fabc7f0..97a00f0 100644
--- a/src/H5Znbit.c
+++ b/src/H5Znbit.c
@@ -904,6 +904,9 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* decompress the buffer */
H5Z_nbit_decompress(outbuf, d_nelmts, *buf, cd_values);
+
+ *buf_size = size_out;
+ ret_value = size_out;
}
/* output; compress */
else {
@@ -917,6 +920,9 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* compress the buffer, size_out will be changed */
H5Z_nbit_compress(*buf, d_nelmts, outbuf, &size_out, cd_values);
+
+ *buf_size = nbytes;
+ ret_value = size_out;
}
/* free the input buffer */
@@ -925,8 +931,6 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* set return values */
*buf = outbuf;
outbuf = NULL;
- *buf_size = size_out;
- ret_value = size_out;
done:
if(outbuf)
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 84d404e..28d8f93 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -1139,8 +1139,8 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu
HDmemcpy(outbuf+buf_offset, *buf, nbytes);
*buf = outbuf;
outbuf = NULL;
- *buf_size = buf_offset+nbytes;
- ret_value = *buf_size;
+ *buf_size = size_out;
+ ret_value = buf_offset+nbytes;
goto done;
}
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 9201a80..b40c028 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -333,7 +333,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
*buf = outbuf;
outbuf = NULL;
*buf_size = nalloc;
- ret_value = nalloc;
+ ret_value = size_out;
}
/* Output; compress */
else {
@@ -359,7 +359,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Set return values */
*buf = outbuf;
outbuf = NULL;
- *buf_size = size_out+4;
+ *buf_size = nbytes+4;
ret_value = size_out+4;
}