summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-03 15:59:49 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-03 15:59:49 (GMT)
commit19707bc2b8bfe520c8fd8418169fc20a6b094f6a (patch)
tree20ae17717f24ea34b12b98010be3956cc9354681
parent51ea45ed2ef8b9bb077a72443eb673c5ed6c0bde (diff)
downloadhdf5-19707bc2b8bfe520c8fd8418169fc20a6b094f6a.zip
hdf5-19707bc2b8bfe520c8fd8418169fc20a6b094f6a.tar.gz
hdf5-19707bc2b8bfe520c8fd8418169fc20a6b094f6a.tar.bz2
[svn-r25393] fix HDFFV-8761:
allocating space for zero-length chunked dataset and asserting.
-rw-r--r--src/H5Dchunk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 0a59ca5..5d7baef 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 */