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

Const correctness of PackedImageDesc #2114

Open
jmather-sesi opened this issue Jan 22, 2025 · 0 comments
Open

Const correctness of PackedImageDesc #2114

jmather-sesi opened this issue Jan 22, 2025 · 0 comments

Comments

@jmather-sesi
Copy link

jmather-sesi commented Jan 22, 2025

In our use case, we are passing const void pointers to build a source PackedImageDesc for use in CPUProcessor::apply. However, PackedImageDesc requires a non-const pointer. I assume this is so that users with non-const data can call getData and modify the result. This makes it dangerous to const_cast our pointer as a caller could then end up inadvertently modifying a const buffer through those calls.

Perhaps there should be a ConstPackedImageDesc? Or is the design to keep the scope of PackedImageDesc tightly around the apply call so that it's unlikely that users can access the getData functions?

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

No branches or pull requests

1 participant