diff options
author | sfan5 <sfan5@live.de> | 2023-12-23 18:46:54 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-12-27 22:55:56 +0100 |
commit | 9565675488c51133e85627e5e610bf631eca6289 (patch) | |
tree | 8b8df1dab6b396097916d5115e8047241a0be910 /audio | |
parent | f57ec94d9f176184414ad8ef916a0b657c1b22ec (diff) | |
download | mpv-9565675488c51133e85627e5e610bf631eca6289.tar.bz2 mpv-9565675488c51133e85627e5e610bf631eca6289.tar.xz |
various: use correct PATH_MAX for win32
In commit c09245cdf2491211f3e0bfe47f28cc0e0a2e05c8
long-path support was enabled for mpv without actually
making sure that there was no code left that used the
old limit (260 Unicode chars) for buffer sizes.
This commit fixes all but one case.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_wasapi_utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 8578b8a863..7e85f75eab 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -576,9 +576,10 @@ static void init_session_display(struct wasapi_state *state, const char *name) { (void **)&state->pSessionControl); EXIT_ON_ERROR(hr); - wchar_t path[MAX_PATH] = {0}; - GetModuleFileNameW(NULL, path, MAX_PATH); + wchar_t *path = talloc_array(NULL, wchar_t, MP_PATH_MAX); + GetModuleFileNameW(NULL, path, MP_PATH_MAX); hr = IAudioSessionControl_SetIconPath(state->pSessionControl, path, NULL); + talloc_free(path); if (FAILED(hr)) { // don't goto exit_label here since SetDisplayName might still work MP_WARN(state, "Error setting audio session icon: %s\n", |