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

Update to stb_image version 2.29 for stbi_info() fix #2880

Conversation

angusdavisadobe
Copy link
Contributor

Description of Change(s)

Update to the latest version of stb_image

Fixes Issue(s)

There was a bug fix to stb_image where previously, stbi_info() (and sbti_info_from_memory()) would return the wrong value for nchannels for a grey scale png image with an alpha channel. For a particular png, stbi_info() would incorrectly return 1 but when later calling stbi_load() with a pre-allocated block of memory to fill, the load method would detect that there are two channels and would overflow memory when decoding, causing a crash in hydra.

The changes are to update to version 2.29 of stb_image and make the appropriate updates to pxr/image/hio/stbImage.cpp to account for api changes to the stb_image_resize functions.

  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@jesschimein
Copy link

Filed as internal issue #USD-9107

@tcauchois
Copy link
Contributor

Hi Angus,

This PR isn't building for us; we get an array overrun in stb_image_resize2.h, that's statically detectable by the compiler. Would you be able to update the PR so it builds?

Thanks!
Tom

@pixar-oss pixar-oss merged commit 005dc10 into PixarAnimationStudios:dev Jun 11, 2024
1 of 5 checks passed
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.

4 participants