summaryrefslogtreecommitdiffstats
path: root/src/H5Tconv.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-12-13 23:33:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-12-13 23:33:05 (GMT)
commit1f4c82143287af0fcbf74514312e7f292caed5ff (patch)
treed4930c97deae37050b12e2c1c35381e068f2be83 /src/H5Tconv.c
parentc701e8b89f694cecbbb5319ec872ef78ea3bfa92 (diff)
downloadhdf5-1f4c82143287af0fcbf74514312e7f292caed5ff.zip
hdf5-1f4c82143287af0fcbf74514312e7f292caed5ff.tar.gz
hdf5-1f4c82143287af0fcbf74514312e7f292caed5ff.tar.bz2
[svn-r3131] Purpose:
Bug fix Description: Non-optimized conversions have a memory overwrite bug when the destination size of a compound datatype is greater than the source size. Solution: Corrected direction of walking through the destination array for final copying. Platforms tested: FreeBSD 4.2 (hawkwind) & Cray J90 (killeen)
Diffstat (limited to 'src/H5Tconv.c')
-rw-r--r--src/H5Tconv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 7ffbc40..8cbca15 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1149,6 +1149,10 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
xbkg += bkg_stride;
}
+ /* If the bkg_stride was set to -(dst->size), make it positive now */
+ if(buf_stride==0 && dst->size>src->size)
+ bkg_stride=dst->size;
+
/*
* Copy the background buffer back into the in-place conversion
* buffer.