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

STBImageResize: stbir_resize_uint8_generic Bad null Check #605

Closed
gudenau opened this issue Dec 4, 2020 · 1 comment
Closed

STBImageResize: stbir_resize_uint8_generic Bad null Check #605

gudenau opened this issue Dec 4, 2020 · 1 comment

Comments

@gudenau
Copy link
Contributor

gudenau commented Dec 4, 2020

Environment

  • LWJGL version: 3.2.2, checked in Master as well
  • LWJGL build #: Unknown
  • Java version: 15
  • Platform: Linux
  • Module: stb

Description

The alloc_context pointer for stbir_resize_uint8_generic is being checked for null, even though the library itself passes NULL to the underlying function calls in stbir_resize_uint8.

stbir_resize_uint8: https://github.com/nothings/stb/blob/master/stb_image_resize.h#L2463
stbir_resize_uint8_generic: https://github.com/nothings/stb/blob/master/stb_image_resize.h#L2506

@Spasi
Copy link
Member

Spasi commented Mar 19, 2021

Thank you @gudenau! The overloads with an explicit alloc_context parameter were generated by mistake. Removed now with 15cc62b.

Note that stb is already configured to use the LWJGL memory allocator internally, so a user-specified allocation context is not necessary.

@Spasi Spasi closed this as completed Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants