glfw-rs icon indicating copy to clipboard operation
glfw-rs copied to clipboard

Do not crash when the GLFW returns a null pointer to an array.

Open rodrigorc opened this issue 4 months ago • 0 comments

Many functions in GLFW return NULL when no data is available. Using slice::from_raw_parts() in a null pointer is not correct, return an empty Vec instead.

For example, calling Joystick::get_buttons() in a non-connected joystick would crash the program. I added a few more checks, just in case.

rodrigorc avatar Oct 11 '25 18:10 rodrigorc