mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[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:
This commit is contained in:
parent
1b7ae2a5b7
commit
78e4e6f008
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user