diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-11 00:34:24 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-11 00:34:24 (GMT) |
commit | 051ffe9d61c067549bc1dab94f9de7ea330e64db (patch) | |
tree | 36112639e4dd5b15b4a5a0f6d1faf50f6f7f1c34 /src/H5Ocache.c | |
parent | 1eb19fc8959e2f4580e7d48633f42a350ca229c3 (diff) | |
download | hdf5-051ffe9d61c067549bc1dab94f9de7ea330e64db.zip hdf5-051ffe9d61c067549bc1dab94f9de7ea330e64db.tar.gz hdf5-051ffe9d61c067549bc1dab94f9de7ea330e64db.tar.bz2 |
[svn-r13492] Description:
Fix mis-calculation of chunk #0 size encoding and also catch a few more
places which adjust the size of chunk and have them adjust the encode flags
also. Add some assertions to object header sanity checking routine.
Tested on:
FreeBSD/32 6.2 (duty)
Diffstat (limited to 'src/H5Ocache.c')
-rw-r--r-- | src/H5Ocache.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 16e6278..142d23f 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -357,11 +357,10 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, /* First chunk size */ UINT32DECODE(p, chunk_size); - } /* end else */ - /* Reserved, in version 1 */ - if(H5O_VERSION_1 == oh->version) + /* Reserved, in version 1 */ p += 4; + } /* end else */ /* Determine object header prefix length */ prefix_size = (size_t)(p - read_buf); @@ -702,14 +701,17 @@ H5O_assert(oh); /* First chunk size */ switch(oh->flags & H5O_HDR_CHUNK0_SIZE) { case 0: /* 1 byte size */ + HDassert(chunk0_size < 256); *p++ = chunk0_size; break; case 1: /* 2 byte size */ + HDassert(chunk0_size < 65536); UINT16ENCODE(p, chunk0_size); break; case 2: /* 4 byte size */ + HDassert(chunk0_size < 4294967296); UINT32ENCODE(p, chunk0_size); break; |