summaryrefslogtreecommitdiffstats
path: root/src/H5Zszip.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-04-11 22:13:44 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-04-11 22:13:44 (GMT)
commit15a0473d746c22992b549238c852bac72ffb006c (patch)
tree2ccfcc5d7e2444da95cfd41d3f5a94261cd3a7f7 /src/H5Zszip.c
parenta471c1ca4af28ff9609cdcccf1b8118e683c94c2 (diff)
downloadhdf5-15a0473d746c22992b549238c852bac72ffb006c.zip
hdf5-15a0473d746c22992b549238c852bac72ffb006c.tar.gz
hdf5-15a0473d746c22992b549238c852bac72ffb006c.tar.bz2
[svn-r6640] Purpose:
Fix Description: This is an analogue to the previous bug-fix for filters not being applied to data written but being applied when read. The old way was if the SZlib library couldn't deflate a dataset, then we'd munge along pretending that it was okay. Solution: Trigger it as an error in this situation. The H5Z_pipeline code which calls this function can clear the error stack if need be. Platforms tested: Modi4 (Parallel & Fortran) Burrwhite (Fortran & C++) Baldric (Fortran), but make check didn't work because of "libucb.so" error that I can't fix...) Misc. update:
Diffstat (limited to 'src/H5Zszip.c')
-rw-r--r--src/H5Zszip.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 1124d1e..ac11dd1 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -312,21 +312,8 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Compress the buffer */
size_out = nbytes;
- if(SZ_OK!= SZ_BufftoBuffCompress(outbuf+4, &size_out, *buf, nbytes, &sz_param)) {
- /* In the event that an error occurs, assume that the buffer
- * could not be compressed and just copy the input buffer to the
- * proper location in the output buffer */
- /* (This is necessary for the szip filter due to the uncompressed
- * size needing to be encoded for the decompression side of things)
- */
- HDmemcpy((void*)(outbuf+4), (void*)(*buf), nbytes);
-
- /* Set correct output size (again) */
- size_out=nbytes;
-
- /* Reset the "nbytes" to encode, so that the decompression side knows that the buffer is uncompressed */
- nbytes=0;
- } /* end if */
+ if(SZ_OK!= SZ_BufftoBuffCompress(outbuf+4, &size_out, *buf, nbytes, &sz_param))
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow");
/* Encode the uncompressed length */
H5_CHECK_OVERFLOW(nbytes,size_t,uint32_t);