Commit ff11902
committed
dwi2mask: Fix segfault with -fslgrad
If dwi2mask is run with the -fslgrad option, this leads to a segmentation fault when constructing the output mask image. check_DW_scheme() is called within a try{} block to determine whether or not any present gradient table should be cleared upon image creation. However the fourth axis is stripped from the DWI header in order to construct this output image header. Within the check_DW_scheme() function, the load_bvecs_bvals() function is called. This function however fails to test whether or not the template header is a 4D image prior to obtaining the number of volumes and comparing this to the number of columns in bvecs / bvals, which leads to a buffer over-run.1 parent 1b818fc commit ff11902
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
0 commit comments