diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-09-03 15:17:46 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-09-03 15:33:50 +0300 |
commit | e576b47521446002a473575f2051ec36c4237bf2 (patch) | |
tree | 6ce645c38d1801d4ce1689473b96c6c771b4f118 /avmedia | |
parent | f50f10ed74975da793cbabef1a96078989fe7bd9 (diff) |
Blind fix to make this perhaps actually work
Change-Id: If99b8f1bf55fe9acd12b9668bf8e8e4386aa44e7
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/vlc/wrapper/SymbolLoader.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/avmedia/source/vlc/wrapper/SymbolLoader.hxx b/avmedia/source/vlc/wrapper/SymbolLoader.hxx index cfc86533e647..8f70dab595c6 100644 --- a/avmedia/source/vlc/wrapper/SymbolLoader.hxx +++ b/avmedia/source/vlc/wrapper/SymbolLoader.hxx @@ -45,10 +45,14 @@ namespace if ( ::RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\VideoLAN\\VLC", 0, KEY_READ, &hKey ) == ERROR_SUCCESS ) { - if ( ::RegQueryValueExW( hKey, L"InstallDir", NULL, &dwType, (LPBYTE) arCurrent, &dwCurrentSize ) == ERROR_SUCCESS ) + if ( ::RegQueryValueExW( hKey, L"InstallDir", NULL, &dwType, (LPBYTE) arCurrent, &dwCurrentSize ) == ERROR_SUCCESS && + dwType == REG_SZ ) { ::RegCloseKey( hKey ); - return OUString( arCurrent, wcslen(arCurrent) ) + "/"; + // The value might be 0-terminated or not + if (arCurrent[dwCurrentSize/2] == 0) + dwCurrentSize -= 2; + return OUString( arCurrent, dwCurrentSize ) + "/"; } ::RegCloseKey( hKey ); |