mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
Merge remote-tracking branch 'origin/develop' into alloc_stats
This commit is contained in:
commit
ae5f556415
@ -1768,6 +1768,7 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf,
|
||||
H5O_token_t token = { 0 };
|
||||
size_t data_size;
|
||||
const uint8_t *p;
|
||||
H5S_t *space = NULL;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_PACKAGE
|
||||
@ -1788,7 +1789,6 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf,
|
||||
|
||||
if(space_ptr) {
|
||||
H5O_loc_t oloc; /* Object location */
|
||||
H5S_t *space = NULL;
|
||||
|
||||
/* Initialize the object location */
|
||||
H5O_loc_reset(&oloc);
|
||||
@ -1812,6 +1812,12 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf,
|
||||
|
||||
done:
|
||||
H5MM_free(data);
|
||||
|
||||
if(ret_value < 0) {
|
||||
if(space && H5S_close(space) < 0)
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
|
||||
}
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5R__decode_token_region_compat() */
|
||||
|
||||
|
@ -690,6 +690,9 @@ H5S__all_deserialize(H5S_t **space, const uint8_t **p)
|
||||
/* Decode version */
|
||||
UINT32DECODE(*p, version);
|
||||
|
||||
if(version < H5S_ALL_VERSION_1 || version > H5S_ALL_VERSION_LATEST)
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for all selection")
|
||||
|
||||
/* Skip over the remainder of the header */
|
||||
*p += 8;
|
||||
|
||||
|
@ -648,6 +648,9 @@ H5S__none_deserialize(H5S_t **space, const uint8_t **p)
|
||||
/* Decode version */
|
||||
UINT32DECODE(*p, version);
|
||||
|
||||
if(version < H5S_NONE_VERSION_1 || version > H5S_NONE_VERSION_LATEST)
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for none selection")
|
||||
|
||||
/* Skip over the remainder of the header */
|
||||
*p += 8;
|
||||
|
||||
|
11
src/H5Spkg.h
11
src/H5Spkg.h
@ -47,14 +47,17 @@
|
||||
#define H5S_HYPER_VERSION_LATEST H5S_HYPER_VERSION_3
|
||||
|
||||
/* Versions for H5S_SEL_POINTS selection info */
|
||||
#define H5S_POINT_VERSION_1 1
|
||||
#define H5S_POINT_VERSION_2 2
|
||||
#define H5S_POINT_VERSION_1 1
|
||||
#define H5S_POINT_VERSION_2 2
|
||||
#define H5S_POINT_VERSION_LATEST H5S_POINT_VERSION_2
|
||||
|
||||
/* Versions for H5S_SEL_NONE selection info */
|
||||
#define H5S_NONE_VERSION_1 1
|
||||
#define H5S_NONE_VERSION_1 1
|
||||
#define H5S_NONE_VERSION_LATEST H5S_NONE_VERSION_1
|
||||
|
||||
/* Versions for H5S_SEL_ALL selection info */
|
||||
#define H5S_ALL_VERSION_1 1
|
||||
#define H5S_ALL_VERSION_1 1
|
||||
#define H5S_ALL_VERSION_LATEST H5S_ALL_VERSION_1
|
||||
|
||||
/* Encoded size of selection info for H5S_SEL_POINTS/H5S_SEL_HYPER */
|
||||
#define H5S_SELECT_INFO_ENC_SIZE_2 0x02 /* 2 bytes: 16 bits */
|
||||
|
@ -1413,6 +1413,9 @@ H5S__point_deserialize(H5S_t **space, const uint8_t **p)
|
||||
/* Decode version */
|
||||
UINT32DECODE(pp, version);
|
||||
|
||||
if(version < H5S_POINT_VERSION_1 || version > H5S_POINT_VERSION_LATEST)
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for point selection")
|
||||
|
||||
if(version >= (uint32_t)H5S_POINT_VERSION_2)
|
||||
/* Decode size of point info */
|
||||
enc_size = *(pp)++;
|
||||
|
Loading…
Reference in New Issue
Block a user