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

Fixes null pointer dereference in https://github.com/nothings/stb/issues/1452 #1454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NBickford-NV
Copy link
Contributor

Hi stb maintainers!

I just saw issue #1452, and put together this pull request to fix it. When stbi__pic_load_core returns NULL, this code now frees the allocated image and returns 0 immediately, instead of passing a null pointer to stbi__convert_format().

Thanks!

… return 0, and the requested number of components to stbi_load_from_memory is not 0 or 4
@musicinmybrain
Copy link

Thank you! I have just applied this as a downstream patch in Fedora Linux.

@NBickford-NV
Copy link
Contributor Author

That's amazingly fast, thank you Ben! (I figured I'd send you an email later this morning since I remember you saw and applied the earlier stb_image patches, but you beat me to it!)

sezero added a commit to libsdl-org/SDL_image that referenced this pull request Feb 25, 2023
sezero added a commit to libsdl-org/SDL_image that referenced this pull request Feb 25, 2023
NBickford-NV added a commit to NBickford-NV/tinygltf that referenced this pull request Mar 29, 2023
@NBickford-NV
Copy link
Contributor Author

Tracking CVE numbers: this is a patch for https://nvd.nist.gov/vuln/detail/CVE-2023-43898 ((#1521).

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.

None yet

2 participants