Celebrandil / CudaSift

A CUDA implementation of SIFT for NVidia GPUs (1.2 ms on a GTX 1060)
MIT License
860 stars 285 forks source link

Bug: out of bounds memory access #81

Open ryan-skydio opened 2 years ago

ryan-skydio commented 2 years ago

In FindMaxCorr10() in matching.cu, if numPts2 < M7H, then this loop will not run:

for (int bp2=0;bp2<numPts2 - M7H + 1;bp2+=M7H) {

which means that indices will retain their initial value of -1, and then at the end of the function this access occurs:

sift1[bp1 + tx].match_xpos = sift2[index].xpos;

with index==-1.