diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2017-12-01 18:41:26 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2017-12-01 18:41:26 (GMT) |
commit | b8c6b68c35fa2be23ef488a1d81097ff3ed55000 (patch) | |
tree | c3429ee577e454526c8704d66a84f0c45b7959a1 /src/H5Spoint.c | |
parent | 23a702e7bad93fc4f14eab07678c75d276e2d0ad (diff) | |
parent | 60f76980aab92f0e0730170b99a2363acd3c97fa (diff) | |
download | hdf5-hdf5-1_8_20.zip hdf5-hdf5-1_8_20.tar.gz hdf5-hdf5-1_8_20.tar.bz2 |
Merge pull request #811 in HDFFV/hdf5 from hdf5_1_8_20 to 1.8/masterhdf5-1_8_20
* commit '60f76980aab92f0e0730170b99a2363acd3c97fa': (108 commits)
Update version numbers and remove empty sections in RELEASE.txt.
Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES.
Update version for 1.8.20 release.
Fixed documentation warnings
HDFFV-10329 Correct LINK INTERFACE and VS20013 compile
Switch default build mode from development to production. Increment version string to pre2.
Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797)
Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0)
Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af)
Fix linking of libs
Changed file path to relative.
iAdd NAG to supported compilers in RELEASE.txt.
Add description to RELEASE.txt for HDFFV-10323
Correct issue number
Set version to 1.8.20-pre1
Update supported and tested platforms in RELEASE.txt.
HDFFV-10321 Merge from 1.8
Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed.
updated issues related to Fortran
Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed.
...
Diffstat (limited to 'src/H5Spoint.c')
-rw-r--r-- | src/H5Spoint.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 36684ea..e1dbb4d 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -821,12 +821,29 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) H5S_pnt_node_t *curr; /* Point information nodes */ uint8_t *lenp; /* pointer to length location for later storage */ uint32_t len=0; /* number of bytes used */ - unsigned u; /* local counting variable */ + unsigned u; /* local counting variable */ + hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounding box */ + hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounding box */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT HDassert(space); + /* Get bounding box for the selection */ + HDmemset(bounds_end, 0, sizeof(bounds_end)); + if(H5S_point_bounds(space, bounds_start, bounds_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") + + /* Determine whether the number of points or the high bounds in the selection exceed (2^32 - 1) */ + if(space->select.num_elem > H5S_UINT32_MAX) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid number of points in selection") + else { + for(u = 0; u < space->extent.rank; u++) + if(bounds_end[u] > H5S_UINT32_MAX) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid points selection") + } + /* Store the preamble information */ UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ UINT32ENCODE(buf, (uint32_t)1); /* Store the version number */ @@ -858,7 +875,8 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_point_serialize() */ |