浏览代码

added bounds check

pull/5621/head
CrackedPixel 1周前
父节点
当前提交
406ad3aedc
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      src/platforms/rcore_desktop_glfw.c

+ 7
- 0
src/platforms/rcore_desktop_glfw.c 查看文件

@ -2178,6 +2178,13 @@ static void CursorEnterCallback(GLFWwindow *window, int enter)
// GLFW3: Joystick connected/disconnected callback
static void JoystickCallback(int jid, int event)
{
if (jid >= MAX_GAMEPADS)
{
// WARNING: If jid is higher than maximum supported joysticks, just return. This
// prevents an out-of-bounds crash on linux when connecting a gamepad to a running app
return;
}
if (event == GLFW_CONNECTED)
{
// WARNING: If glfwGetJoystickName() is longer than MAX_GAMEPAD_NAME_LENGTH,

正在加载...
取消
保存