From ead8e57ed266541368fcdd99c6b9b4d1a19574d7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 6 Oct 1999 13:10:47 -0500 Subject: [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. --- src/H5Odtype.c | 12 ++++++++---- 1 file 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; -- cgit v0.12