fix problem with pre-enddef call to nc_inq_var_szip()

This commit is contained in:
Edward Hartnett 2020-02-04 07:11:44 -07:00
parent 626f40843c
commit a6fbc3eea2
2 changed files with 5 additions and 2 deletions

View File

@ -730,8 +730,8 @@ nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
);
if(stat != NC_NOERR) return stat;
/* Warning: the szip filter internally expands the set of parameters */
if(id != H5Z_FILTER_SZIP || nparams != 4)
return NC_EFILTER; /* not szip or bad # params */
if(id != H5Z_FILTER_SZIP || (nparams != 4 && nparams !=2))
return NC_EFILTER; /* not szip or bad # params */
/* Get params */
stat = ncp->dispatch->inq_var_all(
ncid, varid,

View File

@ -47,6 +47,7 @@ main(void)
int ncid, varid, dimids[2];
size_t dims[2], chunk_size[2];
unsigned int szip_params[2]; /* [0]=options_mask [1]=pixels_per_block */
int options_mask_in, pixels_per_block_in;
int errcnt = 0;
/* Create a new file using read/write access. */
@ -85,6 +86,8 @@ main(void)
ERR;
}
}
if(nc_inq_var_szip(ncid, varid, &options_mask_in, &pixels_per_block_in)) ERR;
if(!(options_mask_in & H5_SZIP_NN_OPTION_MASK)) ERR;
#endif
if(nc_enddef(ncid)) ERR;