winmm: Always allocate at least MAX_PATH bytes in mmioOpenW().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8a22d28766
commit
b9407f75ef
|
@ -734,6 +734,7 @@ HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO* lpmmioinfo,
|
||||||
if (szFileName)
|
if (szFileName)
|
||||||
{
|
{
|
||||||
INT len = WideCharToMultiByte( CP_ACP, 0, szFileName, -1, NULL, 0, NULL, NULL );
|
INT len = WideCharToMultiByte( CP_ACP, 0, szFileName, -1, NULL, 0, NULL, NULL );
|
||||||
|
if (len < MAX_PATH) len = MAX_PATH;
|
||||||
szFn = HeapAlloc( GetProcessHeap(), 0, len );
|
szFn = HeapAlloc( GetProcessHeap(), 0, len );
|
||||||
if (!szFn) return NULL;
|
if (!szFn) return NULL;
|
||||||
WideCharToMultiByte( CP_ACP, 0, szFileName, -1, szFn, len, NULL, NULL );
|
WideCharToMultiByte( CP_ACP, 0, szFileName, -1, szFn, len, NULL, NULL );
|
||||||
|
|
Loading…
Reference in New Issue