summaryrefslogtreecommitdiffstats
path: root/src/H5Dcompact.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-08-26 17:16:50 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-08-26 17:16:50 (GMT)
commit60908b2e12c7ff5f00aab8cd01bd5b6b85189369 (patch)
tree8bb375cc398762413a4a29208ee75cab130605a8 /src/H5Dcompact.c
parentda98c48d44d7a453b20c60c16c876659ffd6c8df (diff)
downloadhdf5-60908b2e12c7ff5f00aab8cd01bd5b6b85189369.zip
hdf5-60908b2e12c7ff5f00aab8cd01bd5b6b85189369.tar.gz
hdf5-60908b2e12c7ff5f00aab8cd01bd5b6b85189369.tar.bz2
[svn-r19309] Description:
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.