MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
294 stars 181 forks source link

Fix invalid memory access when reading colour maps #2974

Closed daljit46 closed 3 months ago

daljit46 commented 3 months ago

In 62861585ac9dedfdc64d2879124ab392ac4736a4, as part of #2911, ColourMap::maps was converted from a null-terminated C array to a std::vector. However, the loops iterating over this list weren't updated and were still relying on null-termination causing an invalid memory access. This also resulted mrview crashing on MacOS. @bjeurissen Could you check if this fixes the crash on your system?

github-actions[bot] commented 3 months ago

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] commented 3 months ago

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] commented 3 months ago

clang-tidy review says "All clean, LGTM! :+1:"

daljit46 commented 3 months ago

Mentioning this for bookkeeping: the changes in this PR have been rebased in dev following discussion in #2859.