summaryrefslogtreecommitdiffstats
path: root/src/H5Sselect.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2019-11-15 22:47:30 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:17:26 (GMT)
commit49a4f6e64bca3576c90baad4ac92e300e7cea480 (patch)
treed4065ca93e65b3b10f5d801c692118fe7cbef0af /src/H5Sselect.c
parent753e0ff0c99d057379afe5bf81006a28b5ef5e93 (diff)
downloadhdf5-49a4f6e64bca3576c90baad4ac92e300e7cea480.zip
hdf5-49a4f6e64bca3576c90baad4ac92e300e7cea480.tar.gz
hdf5-49a4f6e64bca3576c90baad4ac92e300e7cea480.tar.bz2
Modify H5Ssel_iter_get_seq_list() to accept iterators that have reached
the end of iteration (returning zero sequences). Previously it could cause an assertion failure.
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r--src/H5Sselect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 65a66cb..c506218 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -2907,7 +2907,7 @@ H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes,
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "length array pointer is NULL")
/* Get the sequences of bytes */
- if(maxseq > 0 && maxbytes > 0) {
+ if(maxseq > 0 && maxbytes > 0 && sel_iter->elmt_left > 0) {
if(H5S_SELECT_ITER_GET_SEQ_LIST(sel_iter, maxseq, maxbytes, nseq, nbytes, off, len) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "sequence length generation failed")
} /* end if */