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

Uninitialized sliceOptimizationData::type #1741

Closed
matt77hias opened this issue Apr 30, 2024 · 2 comments
Closed

Uninitialized sliceOptimizationData::type #1741

matt77hias opened this issue Apr 30, 2024 · 2 comments

Comments

@matt77hias
Copy link
Contributor

The below code in ImfScanLineInputFile.cpp:

sliceOptimizationData dat;
dat.base      = j.slice ().base;
dat.fill      = fill;
dat.fillValue = j.slice ().fillValue;
dat.offset    = offset;
dat.xStride   = j.slice ().xStride;
dat.yStride   = j.slice ().yStride;
dat.xSampling = j.slice ().xSampling;
dat.ySampling = j.slice ().ySampling;
optData.push_back (dat);

does not assign sliceOptimizationData::type.

Shouldn't data.type = fill ? j.slice ().type : i.channel ().type; be added?

@peterhillman
Copy link
Contributor

Good point! Actually type is never used, because optimization only works if all the channels in optData are HALF channels, so a better solution would be to remove sliceOptimizationData::type completely.
If you'd like to make that change and put in a PR, then go ahead!

@matt77hias
Copy link
Contributor Author

Moved to #1742.

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

2 participants