diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-03-24 21:03:52 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-03-24 21:03:52 (GMT) |
commit | 370a4f930f5a4af3f5866b231b5b799db4506250 (patch) | |
tree | 222c3552e300668d5e7eb9a9a5d00b267776e96d /src/H5Dio.c | |
parent | 7d709797fc7625e646f05702ced307d2ca81a63f (diff) | |
download | hdf5-370a4f930f5a4af3f5866b231b5b799db4506250.zip hdf5-370a4f930f5a4af3f5866b231b5b799db4506250.tar.gz hdf5-370a4f930f5a4af3f5866b231b5b799db4506250.tar.bz2 |
[svn-r8276] *** empty log message ***
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r-- | src/H5Dio.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 13c3422..7be8294 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -176,7 +176,9 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") if (NULL == (buf_type=H5I_object_verify(buf_type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") - + if(H5S_NULL == H5S_get_simple_extent_type(space)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "null dataspace isn't valid") + /* Fill the selection in the memory buffer */ if(H5D_fill(fill,fill_type,buf,buf_type,space, H5AC_dxpl_id)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") @@ -485,7 +487,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(H5S_select_valid(file_space)!=TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") } - + /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == plist_id) plist_id= H5P_DATASET_XFER_DEFAULT; @@ -671,6 +673,9 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, file_space = dataset->space; if (!mem_space) mem_space = file_space; + if(H5S_NULL == H5S_get_simple_extent_type(mem_space) || + H5S_NULL == H5S_get_simple_extent_type(file_space)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "null dataspace isn't supported") if((snelmts = H5S_get_select_npoints(mem_space))<0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); @@ -906,7 +911,10 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, if (!file_space) file_space = dataset->space; if (!mem_space) - mem_space = file_space; + mem_space = file_space; + if(H5S_NULL == H5S_get_simple_extent_type(mem_space) || + H5S_NULL == H5S_get_simple_extent_type(file_space)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "null dataspace isn't supported") if((snelmts = H5S_get_select_npoints(mem_space))<0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); |