diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-11-16 15:14:33 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-11-16 15:14:33 (GMT) |
commit | 133c7ed2e5bc433187f3f88a410f3dbab0b6e7a0 (patch) | |
tree | e82005dc1c6d974c9f2983daf8d2a8c002fd22d3 /src | |
parent | 63c7dbde0104af59884747afdfa37dfe01de0dae (diff) | |
parent | ae9c1bf4199d7ae0f5587485eb4e4d85c5c4cfc4 (diff) | |
download | hdf5-133c7ed2e5bc433187f3f88a410f3dbab0b6e7a0.zip hdf5-133c7ed2e5bc433187f3f88a410f3dbab0b6e7a0.tar.gz hdf5-133c7ed2e5bc433187f3f88a410f3dbab0b6e7a0.tar.bz2 |
Merging in latest from upstream (HDFFV/hdf5:refs/heads/hdf5_1_8_20)
* commit 'ae9c1bf4199d7ae0f5587485eb4e4d85c5c4cfc4':
Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797)
Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0)
Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Oalloc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index c81bdf9..25052e7 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -2200,16 +2200,17 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) oh->nmesgs++; /* Initialize new null message to make the chunk large enough */ - oh->mesg[oh->nmesgs].type = H5O_MSG_NULL; - oh->mesg[oh->nmesgs].dirty = TRUE; - oh->mesg[oh->nmesgs].native = NULL; - oh->mesg[oh->nmesgs].raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; - oh->mesg[oh->nmesgs].raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), + curr_msg = &oh->mesg[oh->nmesgs - 1]; + curr_msg->type = H5O_MSG_NULL; + curr_msg->dirty = TRUE; + curr_msg->native = NULL; + curr_msg->raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; + curr_msg->raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), sizeof_msghdr) - sizeof_msghdr; - oh->mesg[oh->nmesgs].chunkno = chunkno; + curr_msg->chunkno = chunkno; /* update the new chunk size */ - new_size += oh->mesg[oh->nmesgs].raw_size + sizeof_msghdr; + new_size += curr_msg->raw_size + sizeof_msghdr; } /* end if */ /* Check for changing the chunk #0 data size enough to need adjusting the flags */ |