Huw Davies : wineoss: Dynamically size the devnode array.
Alexandre Julliard
julliard at winehq.org
Mon Apr 11 15:55:00 CDT 2022
Module: wine
Branch: master
Commit: aca219367190eb549fb6581914bc30bcad85d7ff
URL: https://source.winehq.org/git/wine.git/?a=commit;h=aca219367190eb549fb6581914bc30bcad85d7ff
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Apr 6 07:55:52 2022 +0100
wineoss: Dynamically size the devnode array.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wineoss.drv/mmdevdrv.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index 5b6addef0f7..eb0ab7b8fc7 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -121,7 +121,6 @@ struct ACImpl {
int fd;
oss_audioinfo ai;
- char devnode[OSS_DEVNODE_SIZE];
BOOL initted, playing;
UINT64 written_frames, last_pos_frames;
@@ -138,6 +137,9 @@ struct ACImpl {
AudioSessionWrapper *session_wrapper;
struct list entry;
+
+ /* Keep at end */
+ char devnode[0];
};
typedef struct _SessionMgr {
@@ -445,6 +447,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
ACImpl *This;
const OSSDevice *oss_dev;
HRESULT hr;
+ int len;
TRACE("%s %p %p\n", debugstr_guid(guid), dev, out);
@@ -453,8 +456,8 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
WARN("Unknown GUID: %s\n", debugstr_guid(guid));
return AUDCLNT_E_DEVICE_INVALIDATED;
}
-
- This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ACImpl));
+ len = strlen(oss_dev->devnode);
+ This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, offsetof(ACImpl, devnode[len + 1]));
if(!This)
return E_OUTOFMEMORY;
More information about the wine-cvs
mailing list