Merge pull request #60 in HDFFV/hdf5 from ~NFORTNE2/hdf5_nf:hdf5_1_8 to hdf5_1_8

* commit '4fe02fbc51944fc9fa392c8ce7e229b8781d70ab':
  Replace assertion in H5O_dtype_decode_helper for number of array dimensions with a check and error. The assertion was inappropriate because it is operating on data read from the file, which the library does not always have direct control of.
This commit is contained in:
Neil Fortner
2016-10-06 11:06:06 -05:00

View File

@@ -518,7 +518,8 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
dt->shared->u.array.ndims = *(*pp)++;
/* Double-check the number of dimensions */
HDassert(dt->shared->u.array.ndims <= H5S_MAX_RANK);
if(dt->shared->u.array.ndims > H5S_MAX_RANK)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "too many dimensions for array datatype")
/* Skip reserved bytes, if version has them */
if(version < H5O_DTYPE_VERSION_3)