diff options
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r-- | src/H5Dchunk.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 7087166..c7baa65 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -406,7 +406,7 @@ H5D_chunk_construct(H5F_t UNUSED *f, H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "external storage not supported with chunked layout") /* Set the last dimension of the chunk size to the size of the datatype */ - dset->shared->layout.u.chunk.dim[dset->shared->layout.u.chunk.ndims - 1] = H5T_GET_SIZE(type); + dset->shared->layout.u.chunk.dim[dset->shared->layout.u.chunk.ndims - 1] = (uint32_t)H5T_GET_SIZE(type); /* Get local copy of dataset dimensions (for sanity checking) */ if(H5S_get_simple_extent_dims(dset->shared->space, NULL, max_dim) < 0) @@ -1740,7 +1740,8 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, io_info->store->chunk.index = chunk_info->index; /* Compute # of bytes accessed in chunk */ - src_accessed_bytes = chunk_info->chunk_points * type_info->src_type_size; + H5_CHECK_OVERFLOW(type_info->src_type_size, /*From:*/ size_t, /*To:*/ uint32_t); + src_accessed_bytes = chunk_info->chunk_points * (uint32_t)type_info->src_type_size; /* Lock the chunk into the cache */ if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, FALSE, &idx_hint))) @@ -1872,7 +1873,8 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, io_info->store->chunk.index = chunk_info->index; /* Compute # of bytes accessed in chunk */ - dst_accessed_bytes = chunk_info->chunk_points * type_info->dst_type_size; + H5_CHECK_OVERFLOW(type_info->dst_type_size, /*From:*/ size_t, /*To:*/ uint32_t); + dst_accessed_bytes = chunk_info->chunk_points * (uint32_t)type_info->dst_type_size; /* Determine if we will access all the data in the chunk */ if(dst_accessed_bytes != ctg_store.contig.dset_size || |