summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-03 15:43:48 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-03 15:43:48 (GMT)
commitee9d595a8cd92de04d79436ffcb8e75195ac5964 (patch)
treedc9fa3ec9da566ece1abe850fc72c0cb6a474efc /src/H5Dchunk.c
parent43b3c20c93bc0adbe1af8915ff0c131542da3c7d (diff)
downloadhdf5-ee9d595a8cd92de04d79436ffcb8e75195ac5964.zip
hdf5-ee9d595a8cd92de04d79436ffcb8e75195ac5964.tar.gz
hdf5-ee9d595a8cd92de04d79436ffcb8e75195ac5964.tar.bz2
[svn-r25392] fix HDFFV-8761:
allocating space for zero-length chunked dataset and asserting.
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index f92260c..20b3c1a 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -743,8 +743,10 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
fm->select_chunk = NULL;
if(io_info->using_mpi_vfd) {
H5_CHECK_OVERFLOW(fm->layout->u.chunk.nchunks, hsize_t, size_t);
- if(NULL == (fm->select_chunk = (H5D_chunk_info_t **)H5MM_calloc((size_t)fm->layout->u.chunk.nchunks * sizeof(H5D_chunk_info_t *))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info")
+ if(fm->layout->u.chunk.nchunks) {
+ if(NULL == (fm->select_chunk = (H5D_chunk_info_t **)H5MM_calloc((size_t)fm->layout->u.chunk.nchunks * sizeof(H5D_chunk_info_t *))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info")
+ }
} /* end if */
#endif /* H5_HAVE_PARALLEL */