summaryrefslogtreecommitdiffstats
path: root/src/H5Dcontig.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Dcontig.c')
-rw-r--r--src/H5Dcontig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index e2fe420..7c1b87c 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -217,8 +217,8 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
store.contig.dset_size = dset->shared->layout.storage.u.contig.size;
/* Get the number of elements in the dataset's dataspace */
- snpoints = H5S_GET_EXTENT_NPOINTS(dset->shared->space);
- HDassert(snpoints >= 0);
+ if((snpoints = H5S_GET_EXTENT_NPOINTS(dset->shared->space)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "dataset has negative number of elements")
H5_ASSIGN_OVERFLOW(npoints, snpoints, hssize_t, size_t);
/* Initialize the fill value buffer */