fangq / mmc

Mesh-based Monte Carlo (MMC)
Other
37 stars 31 forks source link

update tend to ensure that tend - tstart is multiple of tstep #60

Closed ShijieYan closed 3 years ago

ShijieYan commented 3 years ago

In https://github.com/fangq/mmc/blob/1e915a6b6bd7b169b40ab4d3ef7955a5426ecf0f/src/tettracing.c#L984, if cfg->tend > (cfg.tstep * cfg->maxgate) r->Lmove could be larger than it is supposed to be, resulting in out of bound photon position and therefore invalid memory access when saving output to grid.