summaryrefslogtreecommitdiffstats
path: root/src/H5Dcompact.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-08-26 17:27:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-08-26 17:27:56 (GMT)
commite70f164a84307161800856c383a7f6b62ad95007 (patch)
tree7cb6ad4ed1546c37fbfef2979c1a678c5734b6e3 /src/H5Dcompact.c
parent9ab20786abb41c2f2e718da395919cee85664ea9 (diff)
downloadhdf5-e70f164a84307161800856c383a7f6b62ad95007.zip
hdf5-e70f164a84307161800856c383a7f6b62ad95007.tar.gz
hdf5-e70f164a84307161800856c383a7f6b62ad95007.tar.bz2
[svn-r19310] Description:
Bring r19309 from trunk to 1.8 branch: Bring revisions from Coverity branch back to trunk: r19191: Fix coverity items 104 and 105. Added calls to H5HF_sect_indirect_free to H5HF_sect_indirect_reduce and H5HF_sect_indirect_reduce_row if there is an errorbefore "peer_sect" is linked into the main free space structure via its direct sections. Also delayed call to H5HF_sect_indirect_first to prevent peer_sect from being left in an inconsistent state. r19268: Added fix to disallow extendible compact dataset. This was the same check as in H5D_contig_construct() in H5Dcontig.c. Added test to verify the creation of extendible dataset with various layouts. Tested on: Mac OS X/32 10.6.4 (amazon) w/debug & production (h5committested on branch)
Diffstat (limited to 'src/H5Dcompact.c')
-rw-r--r--src/H5Dcompact.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 4f56833..b5bf217 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -168,13 +168,16 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5D_compact_construct(H5F_t *f, H5D_t *dset)
{
hssize_t stmp_size; /* Temporary holder for raw data size */
hsize_t tmp_size; /* Temporary holder for raw data size */
hsize_t max_comp_data_size; /* Max. allowed size of compact data */
+ hsize_t dim[H5O_LAYOUT_NDIMS]; /* Current size of data in elements */
+ hsize_t max_dim[H5O_LAYOUT_NDIMS]; /* Maximum size of data in elements */
+ int ndims; /* Rank of dataspace */
+ int i; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5D_compact_construct)
@@ -183,6 +186,13 @@ H5D_compact_construct(H5F_t *f, H5D_t *dset)
HDassert(f);
HDassert(dset);
+ /* Check for invalid dataset dimensions */
+ if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dim, max_dim)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions")
+ for(i = 0; i < ndims; i++)
+ if(max_dim[i] > dim[i])
+ HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "extendible compact dataset")
+
/*
* Compact dataset is stored in dataset object header message of
* layout.