mfplat: Correctly calculate url scheme length.

When a url is passed in, for example "http://..."
We need to include the : in the scheme string not exclude it.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2022-02-23 12:23:34 +03:00 committed by Alexandre Julliard
parent a3cd6220e4
commit 4662dbd796
1 changed files with 3 additions and 2 deletions

View File

@ -6469,10 +6469,11 @@ static HRESULT resolver_get_scheme_handler(const WCHAR *url, DWORD flags, IMFSch
if (ptr == url || *ptr != ':') if (ptr == url || *ptr != ':')
{ {
url = fileschemeW; url = fileschemeW;
ptr = fileschemeW + ARRAY_SIZE(fileschemeW) - 1; len = ARRAY_SIZE(fileschemeW) - 1;
} }
else
len = ptr - url + 1;
len = ptr - url;
scheme = malloc((len + 1) * sizeof(WCHAR)); scheme = malloc((len + 1) * sizeof(WCHAR));
if (!scheme) if (!scheme)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;