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

Allow only a _raw_ pointer as Deref argument, Deref sampler input and output at the start of GenerateData() #1002

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

N-Dekker
Copy link
Member

@N-Dekker N-Dekker commented Dec 5, 2023

No description provided.

It appears somewhat risky to allow a smart pointer as `Deref` argument, as the original "smart" lifetime management may then be lost, in some cases.

Adjusted `Deref` calls in `AdvancedTransformAdapter` accordingly.

Following InsightSoftwareConsortium/ITK#4278 commit InsightSoftwareConsortium/ITK@042d423 "Add `Deref(T *)`, to ease dereferencing a pointer safely"
`Deref` checks that the input and output pointers are not null. It appears more secure to just do that right at the begin of the `GenerateData()` member function of these ImageSamplers.
@N-Dekker N-Dekker merged commit 0ef6d0d into main Dec 5, 2023
@N-Dekker N-Dekker deleted the Deref-only-raw-pointers branch December 5, 2023 14:06
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.

1 participant