summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1999-10-06 00:38:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1999-10-06 00:38:41 (GMT)
commit66b0cbed3baaa525d80ba952cd8a8991a4647d00 (patch)
treeed855e3d6e1fc4bc21ced214d0b225f47cf9f81c /src
parentc2306a366b51ebb7149b520fde5646f75c4b2556 (diff)
downloadhdf5-66b0cbed3baaa525d80ba952cd8a8991a4647d00.zip
hdf5-66b0cbed3baaa525d80ba952cd8a8991a4647d00.tar.gz
hdf5-66b0cbed3baaa525d80ba952cd8a8991a4647d00.tar.bz2
[svn-r1722] Corrected coding error in computing size of variable-length datatypes, also
allocate "parent" datatype when decoding datatype now.
Diffstat (limited to 'src')
-rw-r--r--src/H5Odtype.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 72253a7..1add673 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -297,10 +297,11 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
case H5T_VLEN: /* Variable length datatypes... */
/* Decode base type of VL information */
+ if (NULL==(dt->parent = H5MM_calloc(sizeof(H5T_t))))
+ HRETURN_ERROR (H5E_DATATYPE, H5E_NOSPACE, NULL, "memory allocation failed");
H5F_addr_undef(&(dt->parent->ent.header));
- if (H5O_dtype_decode_helper(f, pp, dt->parent)<0) {
+ if (H5O_dtype_decode_helper(f, pp, dt->parent)<0)
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode VL parent type");
- }
dt->force_conv=TRUE;
/* Mark this type as on disk */
@@ -838,6 +839,10 @@ H5O_dtype_size(H5F_t *f, const void *mesg)
ret_value += dt->u.enumer.nmembs * dt->parent->size;
break;
+ case H5T_VLEN:
+ ret_value += H5O_dtype_size(f, dt->parent);
+ break;
+
default:
/*no properties */
break;