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

[image output] Initialize pixels of partial tile conversion buffer. #4462

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

stolk
Copy link
Contributor

@stolk stolk commented Sep 29, 2024

When writing a partial tile, the unused pixels still go through float conversion.

This means, that floating point operations are done on uninitialized data.

This can easily lead to NaN and to floating point exceptions, if those were to be enabled.

This change will set the shared buffer used for all partial tiles to all zero pixels.

Tested by running valgrind before and after the change

FIXES: #4461

Description

Tests

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • If I added or modified a C++ API call, I have also amended the
    corresponding Python bindings (and if altering ImageBufAlgo functions, also
    exposed the new functionality as oiiotool options).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

When writing a partial tile, the unused pixels still go through float
conversion.

This means, that floating point operations are done on uninitialized
data.

This can easily lead to NaN and to floating point exceptions, if those
were to be enabled.

This change will set the shared buffer used for all partial tiles to
all zero pixels.

Tested by running valgrind before and after the change

FIXES: AcademySoftwareFoundation#4461

Signed-off-by: Bram Stolk <b.stolk@gmail.com>
Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lgritz lgritz merged commit 970153d into AcademySoftwareFoundation:main Sep 30, 2024
26 checks passed
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Oct 1, 2024
…AcademySoftwareFoundation#4462)

When writing a partial tile, the unused pixels still go through float
conversion.

This means, that floating point operations are done on uninitialized
data.

This can easily lead to NaN and to floating point exceptions, if those
were to be enabled.

This change will set the shared buffer used for all partial tiles to all
zero pixels.

Tested by running valgrind before and after the change

FIXES: AcademySoftwareFoundation#4461

Signed-off-by: Bram Stolk <b.stolk@gmail.com>
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.

[BUG] Floating point operations performed on unitialized values.
2 participants