From 1f4c82143287af0fcbf74514312e7f292caed5ff Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 13 Dec 2000 18:33:05 -0500 Subject: [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) --- src/H5Tconv.c | 4 ++++ 1 file changed, 4 insertions(+) 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. -- cgit v0.12