diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-31 20:28:47 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-12-31 20:28:47 (GMT) |
commit | 502b49b2b91d25e16668d8eee1610f7a2fe00fc7 (patch) | |
tree | 477fff080d993b8554f229cb29307be4a7273d69 /src/H5Zszip.c | |
parent | 9599f877c37caf9b0d5d8c33e4b7d13cf056d690 (diff) | |
download | hdf5-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/H5Zszip.c')
-rw-r--r-- | src/H5Zszip.c | 4 |
1 files changed, 4 insertions, 0 deletions
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"); |