summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-07-16 19:52:43 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-07-16 19:52:43 (GMT)
commit55666ace551369b3d72430c090ab9f1571e1be75 (patch)
tree17569dc0d6a7d90f0ed16e5e817718c5551f0299 /src/H5Dchunk.c
parent2725634ed99d330d38f449ac92203913f1fd2c55 (diff)
parent83ca39ba9a2d6852dd7754b533f7839e9d2a0107 (diff)
downloadhdf5-55666ace551369b3d72430c090ab9f1571e1be75.zip
hdf5-55666ace551369b3d72430c090ab9f1571e1be75.tar.gz
hdf5-55666ace551369b3d72430c090ab9f1571e1be75.tar.bz2
Merge pull request #1134 in HDFFV/hdf5 from ~BMRIBLER/hdf5_bmr_cpp4:develop to develop
Fixed HDFFV-10481 and HDFFV-10477 * commit '83ca39ba9a2d6852dd7754b533f7839e9d2a0107': Combined macro lines as Dana commented Platforms tested: Linux/64 (jelly) (very minor) Fixed division-by-zero issues Description: Fixed HDFFV-10481 and HDFFV-10477, division by 0. Fixed another occurrence beside what were reported. Also, changed a local variable to avoid an unnecessary cast. Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test)
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index e64a60f..4906f3c 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -947,6 +947,8 @@ H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id)
hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */
/* Initial scaled dimension sizes */
+ if(dset->shared->layout.u.chunk.dim[u] == 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "chunk size must be > 0, dim = %u ", u)
rdcc->scaled_dims[u] = dset->shared->curr_dims[u] / dset->shared->layout.u.chunk.dim[u];
if( !(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u])) )