Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3dRetinoPhase delay based estimation seg fault fix #627

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bogpetre
Copy link

@bogpetre bogpetre commented May 1, 2024

3dRetinoPhase initializes the Delay based method of estimation by invoking hilbertdelay_V2reset(); This is just a simple wrapper for hilbertdelay_V2() which it calls with opt=0, *del=NULL and *xcorCoef=Null arguments, among others. This combination of parameters results in the dereferencing of the del and xcorCoeff pointers on lines 1292 and 1293 of plug_delay_V2.h when an attempt is made to assign them values, but for null pointers this operation causes a segmentation fault.

Instead we can determine if there's anything to compute after cleaning up all the other variables in the opt=0 block from lines 1245 - 1289, and if the x and y variables are NULL then we return at that point. This implicitly avoids dereferencing the NULL del and xcorCoef pointers since x and y should be NULL anytime del and xcorCoef are NULL.

This issue is discussed more fully in Issue #556

3dRetinoPhase initializes the Delay based method of estimation by invoking hilbertdelay_V2reset(); This is just a simple wrapper for hilbertdelay_V2() which it calls with opt=0, *del=NULL and *xcorCoef=Null arguments, among others. This combination of parameters results in the dereferencing of the del and xcorCoeff pointers on lines 1292 and 1293 of plug_delay_V2.h when an attempt is made to assign them values, but for null pointers this operation causes a segmentation fault.

Instead we can determine if there's anything to compute after cleaning up all the other variables in the opt=0 block from lines 1245 - 1289, and if the x and y variables are NULL then we return at that point. This implicitly avoids dereferencing the NULL del and xcorCoef pointers since x and y should be NULL anytime del and xcorCoef are NULL.

This issue is discussed more fully in Issue afni#556
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant