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 /video/out/w32_common.c | |
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 'video/out/w32_common.c')
-rw-r--r-- | video/out/w32_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index c7b34d36f7..e15ead8f68 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -578,18 +578,20 @@ static double get_refresh_rate_from_gdi(const wchar_t *device) static char *get_color_profile(void *ctx, const wchar_t *device) { char *name = NULL; + wchar_t *wname = NULL; HDC ic = CreateICW(device, NULL, NULL, NULL); if (!ic) goto done; - wchar_t wname[MAX_PATH + 1]; - if (!GetICMProfileW(ic, &(DWORD){ MAX_PATH }, wname)) + wname = talloc_array(NULL, wchar_t, MP_PATH_MAX); + if (!GetICMProfileW(ic, &(DWORD){ MP_PATH_MAX - 1 }, wname)) goto done; name = mp_to_utf8(ctx, wname); done: if (ic) DeleteDC(ic); + talloc_free(wname); return name; } |