summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-09-03 15:17:46 +0300
committerTor Lillqvist <tml@iki.fi>2013-09-03 15:33:50 +0300
commite576b47521446002a473575f2051ec36c4237bf2 (patch)
tree6ce645c38d1801d4ce1689473b96c6c771b4f118 /avmedia
parentf50f10ed74975da793cbabef1a96078989fe7bd9 (diff)
Blind fix to make this perhaps actually work
Change-Id: If99b8f1bf55fe9acd12b9668bf8e8e4386aa44e7
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/vlc/wrapper/SymbolLoader.hxx8
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 );