Alistair Leslie-Hughes : mfplat: Correctly calculate url scheme length.

Alexandre Julliard julliard at winehq.org
Wed Feb 23 16:00:05 CST 2022


Module: wine
Branch: master
Commit: 4662dbd796a8feac494de1ae26c6ab6005e829da
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4662dbd796a8feac494de1ae26c6ab6005e829da

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Wed Feb 23 12:23:34 2022 +0300

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 at hotmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mfplat/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 7991152f7a7..cee052defeb 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -6469,10 +6469,11 @@ static HRESULT resolver_get_scheme_handler(const WCHAR *url, DWORD flags, IMFSch
     if (ptr == url || *ptr != ':')
     {
         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));
     if (!scheme)
         return E_OUTOFMEMORY;




More information about the wine-cvs mailing list