From 15a0473d746c22992b549238c852bac72ffb006c Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 11 Apr 2003 17:13:44 -0500 Subject: [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: --- src/H5Zszip.c | 17 ++--------------- 1 file 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); -- cgit v0.12