summaryrefslogtreecommitdiffstats
path: root/src/H5Odtype.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1999-10-06 18:10:47 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1999-10-06 18:10:47 (GMT)
commitead8e57ed266541368fcdd99c6b9b4d1a19574d7 (patch)
treee0c6a32b0f54b4c6839e83aa42385a3ffb3e03cf /src/H5Odtype.c
parent44fa8e1e3e070bbd21b5cb10935359038507e6f2 (diff)
downloadhdf5-ead8e57ed266541368fcdd99c6b9b4d1a19574d7.zip
hdf5-ead8e57ed266541368fcdd99c6b9b4d1a19574d7.tar.gz
hdf5-ead8e57ed266541368fcdd99c6b9b4d1a19574d7.tar.bz2
[svn-r1728] Corrected two bugs in VL types, one in which the wrong length of the buffer
needed for the object header was being computed and another in incorrectly decoding the "base" type of the VL type.
Diffstat (limited to 'src/H5Odtype.c')
-rw-r--r--src/H5Odtype.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 569c635..420d70a 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -300,16 +300,16 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
dt->u.vlen.type = (H5T_vlen_type_t)(flags & 0x0f);
/* 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");
dt->parent->ent.header = HADDR_UNDEF;
- 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 */
- if (H5T_vlen_mark(dt, f, H5T_VLEN_DISK)<0) {
+ if (H5T_vlen_mark(dt, f, H5T_VLEN_DISK)<0)
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location");
- }
break;
default:
@@ -845,6 +845,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;