summaryrefslogtreecommitdiffstats
path: root/src/H5Zscaleoffset.c
diff options
context:
space:
mode:
authorXiaowen Wu <wuxiaowe@ncsa.uiuc.edu>2005-04-29 22:52:51 (GMT)
committerXiaowen Wu <wuxiaowe@ncsa.uiuc.edu>2005-04-29 22:52:51 (GMT)
commit78e4e6f008b8eba2930880058c5e475e2ee2691e (patch)
treee4e5e2082468bbba203d05161233bc2baf924773 /src/H5Zscaleoffset.c
parent1b7ae2a5b729ce09209b36a47dd80a74b8cdadbc (diff)
downloadhdf5-78e4e6f008b8eba2930880058c5e475e2ee2691e.zip
hdf5-78e4e6f008b8eba2930880058c5e475e2ee2691e.tar.gz
hdf5-78e4e6f008b8eba2930880058c5e475e2ee2691e.tar.bz2
[svn-r10702] Purpose:
Bug fix. Description: The previous bug fix of H5Zscaleoffset filter was not secure enough. Solution: Slight modification based on previous version. Platforms tested: heping Misc. update:
Diffstat (limited to 'src/H5Zscaleoffset.c')
-rw-r--r--src/H5Zscaleoffset.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 3dfd7ac..81783e4 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -290,17 +290,17 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{
{ \
if(sizeof(type)==sizeof(int)) { \
if(H5Z_scaleoffset_rnd(max*HDpow(10, D_val) - min*HDpow(10, D_val)) \
- >= ~(unsigned int)0 - 2) { \
+ > HDpow(2, sizeof(int)*8 - 1)) { \
*minbits = sizeof(int)*8; goto done; \
} \
} else if(sizeof(type)==sizeof(long)) { \
if(H5Z_scaleoffset_rnd(max*HDpow(10, D_val) - min*HDpow(10, D_val)) \
- >= ~(unsigned long)0 - 2) { \
+ > HDpow(2, sizeof(long)*8 - 1)) { \
*minbits = sizeof(long)*8; goto done; \
} \
} else if(sizeof(type)==sizeof(long_long)) { \
if(H5Z_scaleoffset_rnd(max*HDpow(10, D_val) - min*HDpow(10, D_val)) \
- >= ~(unsigned long_long)0 - 2) { \
+ > HDpow(2, sizeof(long_long)*8 - 1)) { \
*minbits = sizeof(long_long)*8; goto done; \
} \
} else \