-
Notifications
You must be signed in to change notification settings - Fork 602
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
fix(exr): Avoid integer overflow for large deep exr slice strides #4542
Conversation
Original reporter of #4540 reported there that they applied this patch on their end and it fixes the problem. |
src/openexr.imageio/exroutput.cpp
Outdated
@@ -1729,15 +1729,15 @@ OpenEXROutput::write_deep_scanlines(int ybegin, int yend, int /*z*/, | |||
frameBuffer.insertSampleCountSlice(countslice); | |||
std::vector<void*> pointerbuf; | |||
dd->get_pointers(pointerbuf); | |||
size_t slchans = size_t(m_spec.width) * size_t(nchans); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that caused me to do a double-take in this PR is that this line doesn't mirror the form used in exrinput. Can we declare nchans as size_t above (assuming m_spec.nchannels is already known to be >= 0) so that this entire block of code will match what is used in exrinput? i.e. there's 3 casts to size_t in this block whereas the ones in exrinput has none.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So updated (delay was for fixing the great GHA failure of 2024).
Fixes 4540 Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com>
…ademySoftwareFoundation#4542) Fixes AcademySoftwareFoundation#4540 --------- Signed-off-by: Larry Gritz <lg@larrygritz.com>
Fixes #4540