]> git.sesse.net Git - vlc/blobdiff - activex/plugin.h
* added the needed libraries for UPnP-support on OSX
[vlc] / activex / plugin.h
index f95aef55f0635efeccda0ad0eef47d9a45a74310..800aceb76b9c96ca660389eb0808f75718506585 100644 (file)
@@ -90,7 +90,7 @@ public:
     void setMRL(BSTR mrl)
     {
         SysFreeString(_bstr_mrl);
-        _bstr_mrl = SysAllocString(mrl);
+        _bstr_mrl = SysAllocStringLen(mrl, SysStringLen(mrl));
         setDirty(TRUE);
     };
     const BSTR getMRL(void) { return _bstr_mrl; };
@@ -143,7 +143,14 @@ public:
     void setFocus(BOOL fFocus);
 
     inline UINT getCodePage(void) { return _i_codepage; };
-    inline void setCodePage(UINT cp) { _i_codepage = cp; };
+    inline void setCodePage(UINT cp)
+    {
+        // accept new codepage only if it works on this system
+        size_t mblen = WideCharToMultiByte(cp,
+                0, L"test", -1, NULL, 0, NULL, NULL);
+        if( mblen > 0 )
+            _i_codepage = cp;
+    };
 
     inline BOOL isUserMode(void) { return _b_usermode; };
     inline void setUserMode(BOOL um) { _b_usermode = um; };