-
Notifications
You must be signed in to change notification settings - Fork 645
Fix Deep Scanline Input crash when using a framebuffer as parameter #2019
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
base: main
Are you sure you want to change the base?
Fix Deep Scanline Input crash when using a framebuffer as parameter #2019
Conversation
Does this reveal a hole in our testing? Is there a test that can be added to validate the fix? Does the same bug exist for deep tiled input? |
Yes, there seems to be a hole in testing, since these overloaded functions are not being used in any of the existing tests. I will give it a go to add a case to one of the existing tests that uses these functions to extend our coverage. I think that DeepTiledInput is not affected by this issue, since it seems to be using a different code path, and does not seem to use the problematic function (readMemData). |
58e6484
to
9720aab
Compare
…ebuffer The Deep Scanline Input code has recently been rewritten to make use of the EXR core library. As a result a bug was introduced when using the overloads of readPixels() and readPixelSampleCounts() that use externally provided framebuffers as parameters, a hard crash was occuring. According to the comment on the header of these functions, when these overloads are used the InputFile's frameBuffer is not used. However both these functions call into readMemData(), which does use the InputFile's member framebuffer, which has not been allocated, resulting into a segmentation fault. This commit fixes the above issue, by using the parameter framebuffer that is passed in, which should be allocated by the caller application. Signed-off-by: Nikolaos Koutsikos <[email protected]>
After having found a bug with the readPixels() and readPixelSampleCounts() overloads that receive a framebuffer parameter, it was made apparent that there was a hole in our tests to cover these functions. This commits slightly refactors the DeepScanLineBasic tests and adds a third read path to add coverage for this case as well. Signed-off-by: Nikolaos Koutsikos <[email protected]>
9720aab
to
7ca2ed0
Compare
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.
Looks good! Thanks for the fix to the library and to the test.
The Deep Scanline Input code has recently been rewritten to make use of the EXR core library. As a result a bug was introduced when using the overloads of readPixels() and readPixelSampleCounts() that use externally provided framebuffers as parameters, a hard crash was occuring. According to the comment on the header of these functions, when these overloads are used the InputFile's frameBuffer is not used.
However both these functions call into readMemData(), which does use the InputFile's member framebuffer, which has not been allocated, resulting into a segmentation fault.
This commit fixes the above issue, by using the parameter framebuffer that is passed in, which should be allocated by the caller application.
Closes #2020