Merge pull request #2043 in HDFFV/hdf5 from ~NFORTNE2/hdf5_naf:seq_list_fix to develop

* commit 'c104f4cb87a1558ab6a772967887738dc9800f0d':
  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.
This commit is contained in:
Neil Fortner 2019-11-20 12:02:46 -06:00
commit 33d173d672

View File

@ -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") HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "length array pointer is NULL")
/* Get the sequences of bytes */ /* 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) 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") HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "sequence length generation failed")
} /* end if */ } /* end if */