[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:
This commit is contained in:
Bill Wendling 2003-04-11 17:13:44 -05:00
parent a471c1ca4a
commit 15a0473d74

View File

@ -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);