summaryrefslogtreecommitdiffstats
path: root/src/H5FDspace.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-09-08 21:16:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-09-08 21:16:31 (GMT)
commitd5c362618144381b3d2cb8030b6cd75d75bbe1bf (patch)
tree0a84d9afaa69572fe2efb9fd5511fb19959f26a4 /src/H5FDspace.c
parentef70e5799952bc217d1c7e0bf300257a3d87f8ef (diff)
downloadhdf5-d5c362618144381b3d2cb8030b6cd75d75bbe1bf.zip
hdf5-d5c362618144381b3d2cb8030b6cd75d75bbe1bf.tar.gz
hdf5-d5c362618144381b3d2cb8030b6cd75d75bbe1bf.tar.bz2
[svn-r17460] Description:
Bring r17459 from trunk to v1.8 branch: Correct bad interaction between non-zero userblocks with non-zero alignments. Also add some additional range checking and tests for invalid userblock sizes. Tested on: FreeBSD/32 6.3 (duty) in debug mode (h5committested on trunk)
Diffstat (limited to 'src/H5FDspace.c')
-rw-r--r--src/H5FDspace.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5FDspace.c b/src/H5FDspace.c
index 5526b03..19f9281 100644
--- a/src/H5FDspace.c
+++ b/src/H5FDspace.c
@@ -149,9 +149,11 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hbool_t new_block, hsize_t size, hadd
/* Check for EOA already aligned */
if((mis_align = (eoa % file->alignment)) > 0) {
extra = file->alignment - mis_align;
- if (frag_addr) *frag_addr = eoa;
- if (frag_size) *frag_size = extra;
- }
+ if(frag_addr)
+ *frag_addr = eoa - file->base_addr; /* adjust for file's base address */
+ if(frag_size)
+ *frag_size = extra;
+ } /* end if */
} /* end if */
/* Add in extra allocation amount */