summaryrefslogtreecommitdiffstats
path: root/src/H5Sselect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r--src/H5Sselect.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index a9c0aa1..153c691 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -482,9 +482,14 @@ H5S_select_deserialize(H5S_t **space, const uint8_t **p)
/* Decode the rank of the point selection */
UINT32DECODE(*p,rank);
- if(!*space)
+ if(!*space) {
+ hsize_t dims[H5S_MAX_RANK];
+
/* Patch the rank of the allocated dataspace */
- tmp_space->extent.rank = rank;
+ (void)HDmemset(dims, 0, (size_t)rank * sizeof(dims[0]));
+ if(H5S_set_extent_simple(tmp_space, rank, dims, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions")
+ } /* end if */
else
/* Verify the rank of the provided dataspace */
if(rank != tmp_space->extent.rank)