summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-12-31 20:28:47 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-12-31 20:28:47 (GMT)
commit502b49b2b91d25e16668d8eee1610f7a2fe00fc7 (patch)
tree477fff080d993b8554f229cb29307be4a7273d69 /src
parent9599f877c37caf9b0d5d8c33e4b7d13cf056d690 (diff)
downloadhdf5-502b49b2b91d25e16668d8eee1610f7a2fe00fc7.zip
hdf5-502b49b2b91d25e16668d8eee1610f7a2fe00fc7.tar.gz
hdf5-502b49b2b91d25e16668d8eee1610f7a2fe00fc7.tar.bz2
[svn-r8008] Purpose:
Bug fix Description: Range check the szip 'pixels per block' against the chunk size of the dataset when attempting to create a new dataset, since the szip library requires the PPB to be at least the size of the fastest changing dimension in the chunk. Platforms tested: FreeBSD 4.9 (sleipnir) too minor for h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5Z.c6
-rw-r--r--src/H5Zszip.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/H5Z.c b/src/H5Z.c
index c687da8..bf721b6 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -575,7 +575,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
/* Check return value */
if(status<=0) {
/* We're leaving, so close dataspace */
- if(H5Sclose(space_id)<0)
+ if(H5I_dec_ref(space_id)<0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace");
/* Indicate filter can't apply to this combination of parameters */
@@ -596,7 +596,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
/* Make callback to filter's "set local" function */
if((fclass->set_local)(dcpl_id, type_id, space_id)<0) {
/* We're leaving, so close dataspace */
- if(H5Sclose(space_id)<0)
+ if(H5I_dec_ref(space_id)<0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace");
/* Indicate error during filter callback */
@@ -612,7 +612,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
} /* end for */
/* Close dataspace */
- if(H5Sclose(space_id)<0)
+ if(H5I_dec_ref(space_id)<0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace");
} /* end if */
} /* end if */
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index d081521..76cf017 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -129,6 +129,10 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
if(scanline > SZ_MAX_PIXELS_PER_SCANLINE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid scanline size");
+ /* Range check the pixels per block against the 'scanline' size */
+ if(scanline<cd_values[H5Z_SZIP_PARM_PPB])
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "pixels per block greater than scanline");
+
/* Range check the scanline's number of blocks */
if((scanline/cd_values[H5Z_SZIP_PARM_PPB]) > SZ_MAX_BLOCKS_PER_SCANLINE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid number of blocks per scanline");