summaryrefslogtreecommitdiffstats
path: root/src/H5Dio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r--src/H5Dio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 9fd24d3..3c36953 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -284,9 +284,10 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_t
/* Convert disk buffer into memory buffer */
if(!H5T_path_noop(tpath)) {
/* Allocate a background buffer */
- if(NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, (size_t)nelmts * buf_size)))
+ if(H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, (size_t)nelmts * buf_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ /* Perform datatype conversion */
if(H5T_convert(tpath, src_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf, dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed")
} /* end if */
@@ -298,7 +299,7 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_t
if(!H5T_path_noop(tpath)) {
/* If there's no VL type of data, do conversion first then fill the data into
* the memory buffer. */
- if(NULL == (bkg_buf = H5FL_BLK_CALLOC(type_elem, buf_size)))
+ if(H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_elem, buf_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Perform datatype conversion */