mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
[svn-r5272] Purpose:
Bug fix Description: Move iterator initialization in H5D_read & H5D_write before any errors can occur. Platforms tested: FreeBSD 4.5 (sleipnir)
This commit is contained in:
parent
80043b04c0
commit
124979bfc2
20
src/H5D.c
20
src/H5D.c
@ -2250,6 +2250,11 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
|
||||
assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
|
||||
|
||||
/* Initialize these before any errors can occur */
|
||||
HDmemset(&mem_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&bkg_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&file_iter,0,sizeof(H5S_sel_iter_t));
|
||||
|
||||
/* Get the dataset's creation property list */
|
||||
if (NULL == (dc_plist = H5I_object(dataset->dcpl_id)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list");
|
||||
@ -2258,11 +2263,6 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
if (NULL == (dx_plist = H5I_object(dxpl_id)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list");
|
||||
|
||||
/* Initialize these before any errors can occur */
|
||||
HDmemset(&mem_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&bkg_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&file_iter,0,sizeof(H5S_sel_iter_t));
|
||||
|
||||
if (!file_space) {
|
||||
if (NULL==(free_this_space=H5S_read (&(dataset->ent))))
|
||||
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data space from dataset header");
|
||||
@ -2664,6 +2664,11 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
|
||||
assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
|
||||
|
||||
/* Initialize these before any errors can occur */
|
||||
HDmemset(&mem_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&bkg_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&file_iter,0,sizeof(H5S_sel_iter_t));
|
||||
|
||||
/* Get the dataset's creation property list */
|
||||
if (NULL == (dc_plist = H5I_object(dataset->dcpl_id)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list");
|
||||
@ -2689,11 +2694,6 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing region reference datatypes yet");
|
||||
#endif
|
||||
|
||||
/* Initialize these before any errors can occur */
|
||||
HDmemset(&mem_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&bkg_iter,0,sizeof(H5S_sel_iter_t));
|
||||
HDmemset(&file_iter,0,sizeof(H5S_sel_iter_t));
|
||||
|
||||
if (0==(H5F_get_intent(dataset->ent.file) & H5F_ACC_RDWR))
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user