mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Added dinput-regression-fix patchset
This commit is contained in:
parent
a7f29f1236
commit
75f3eede59
@ -0,0 +1,29 @@
|
||||
From 434df65f9023ec64c175825e5b38cd9daf744565 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Aida=20Jonikien=C4=97?= <aidas957@gmail.com>
|
||||
Date: Sat, 10 Aug 2024 22:20:30 +0300
|
||||
Subject: [PATCH] dinput: Use the correct array index in
|
||||
keyboard_create_device().
|
||||
|
||||
This fixes a segfault when launching NFS Underground.
|
||||
|
||||
Fixes: f434ea12b83 ("dinput: Implement DIPROP_SCANCODE.")
|
||||
---
|
||||
dlls/dinput/keyboard.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
|
||||
index a83f825e97d..aee1d996dde 100644
|
||||
--- a/dlls/dinput/keyboard.c
|
||||
+++ b/dlls/dinput/keyboard.c
|
||||
@@ -211,7 +211,7 @@ HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirect
|
||||
|
||||
if (FAILED(hr = dinput_device_init_device_format( &impl->base.IDirectInputDevice8W_iface ))) goto failed;
|
||||
|
||||
- for (i = 0, index = 0; i < 512; ++i)
|
||||
+ for (i = 0, index = 0; i < impl->base.device_format.dwNumObjs; ++i)
|
||||
{
|
||||
if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
|
||||
if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
|
||||
--
|
||||
2.43.0
|
||||
|
5
patches/dinput-regression-fix/definition
Normal file
5
patches/dinput-regression-fix/definition
Normal file
@ -0,0 +1,5 @@
|
||||
Fixes: Fix crash in NFS Underground
|
||||
#Depends: dinput-joy-mappings
|
||||
Depends: dinput-scancode
|
||||
|
||||
# PR 6249
|
Loading…
Reference in New Issue
Block a user