summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2019-06-20 17:37:27 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2019-06-20 17:37:27 (GMT)
commit27d5742b3956622dd41d2edf89d20314224c5f38 (patch)
tree4efb591d864060b66a6b0f410cff57a338bb8805 /src/H5Dchunk.c
parent63fc460c137e871d21941de8fedc4371be229d42 (diff)
parent2e973f7e12301975f9d8dfdd5534682525554e77 (diff)
downloadhdf5-27d5742b3956622dd41d2edf89d20314224c5f38.zip
hdf5-27d5742b3956622dd41d2edf89d20314224c5f38.tar.gz
hdf5-27d5742b3956622dd41d2edf89d20314224c5f38.tar.bz2
Merge branch 'develop' into bugfix/repack_external_storage
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 60f2d8b..a8dc398 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -707,15 +707,18 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims,
/* Compute the # of chunks in dataset dimensions */
for(u = 0, layout->nchunks = 1, layout->max_nchunks = 1; u < ndims; u++) {
- /* Sanity check */
- HDassert(layout->dim[u] > 0);
-
/* Round up to the next integer # of chunks, to accommodate partial chunks */
layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u];
if(H5S_UNLIMITED == max_dims[u])
layout->max_chunks[u] = H5S_UNLIMITED;
else
+ {
+ /* Sanity check */
+ if(layout->dim[u] == 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "dimension size must be > 0, dim = %u ", u)
+
layout->max_chunks[u] = ((max_dims[u] + layout->dim[u]) - 1) / layout->dim[u];
+ }
/* Accumulate the # of chunks */
layout->nchunks *= layout->chunks[u];