diff options
author | Tomas Farago <sensej007@email.cz> | 2020-03-19 13:34:09 +0100 |
---|---|---|
committer | Tomas Farago <sensej007@email.cz> | 2020-03-19 13:35:08 +0100 |
commit | b74bd263983a3dc1006ceceaf9552dc322ef8858 (patch) | |
tree | fac679d673002e4fa456056d43e9729db32811e1 | |
parent | 581a1b2cf040ca346a825ef5bfed6465ab3ea8d5 (diff) | |
download | ufo-filters-b74bd263983a3dc1006ceceaf9552dc322ef8858.tar.gz ufo-filters-b74bd263983a3dc1006ceceaf9552dc322ef8858.tar.bz2 ufo-filters-b74bd263983a3dc1006ceceaf9552dc322ef8858.tar.xz ufo-filters-b74bd263983a3dc1006ceceaf9552dc322ef8858.zip |
med-mad-reject-2d: fix index overflow in sorting
-rw-r--r-- | contrib/kernels/med-mad-reject-2d.cl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/kernels/med-mad-reject-2d.cl b/contrib/kernels/med-mad-reject-2d.cl index ce1e26d..90abe7c 100644 --- a/contrib/kernels/med-mad-reject-2d.cl +++ b/contrib/kernels/med-mad-reject-2d.cl @@ -62,7 +62,7 @@ med_mad_rej_2D ( float swapper; /* Computing the median : */ - for (index = 0; num_px != (1+index); ++index) { + for (index = 1; num_px != index; ++index) { for (size_t j = 0; j!= (num_px-index); ++j ) { swapper = v[j]; v[j] = min(v[j], v[j+1]); @@ -78,7 +78,7 @@ med_mad_rej_2D ( for ( index = (num_px>>1) ; num_px != index; ++index) { v[index] = v[index] - med; } - for (index = 0; num_px != (1+index); ++index) { + for (index = 1; num_px != index; ++index) { for (size_t j = 0; j!= (num_px-index); ++j ) { swapper = v[j]; v[j] = min(v[j], v[j+1]); |