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/H5Odbg.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/H5Odbg.c')
-rw-r--r-- | src/H5Odbg.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/H5Odbg.c b/src/H5Odbg.c index a5428c1..b4d642b 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -136,6 +136,20 @@ H5O_assert(const H5O_t *oh) HDassert(oh->chunk[u].gap == 0); } /* end for */ + /* Check for correct chunk #0 size flags */ + if(oh->version > H5O_VERSION_1) { + uint64_t chunk0_size = oh->chunk[0].size - H5O_SIZEOF_HDR(oh); + + if(chunk0_size <= 255) + HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1); + else if(chunk0_size <= 65535) + HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_2); + else if(chunk0_size <= 4294967295) + HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_4); + else + HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_8); + } /* end if */ + /* Loop over all messages in object header */ for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { /* Accumulate information, based on the type of message */ |