]> git.sesse.net Git - vlc/blobdiff - activex/persiststreaminit.cpp
* Fix the duration of the dvdread module. refs #198.
[vlc] / activex / persiststreaminit.cpp
index c62736e9434c36bc1002aa0fd19f52a4065aab4d..df67050635767c3c1907fb879974de6f0e934eb1 100644 (file)
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #include "plugin.h"
@@ -76,6 +76,7 @@ public:
         VARIANT arg;
         V_VT(&arg) = VT_BSTR;
         V_BSTR(&arg) = bstr;
+        VariantInit(&_v);
         VariantCopy(&_v, &arg);
     };
 
@@ -153,7 +154,8 @@ public:
 
     inline bool operator==(const AxVLCWSTR &s) const
     {
-        return compareNoCase(s.wstr()) == 0;
+        return size() == s.size() ?
+                    (compareNoCase(s.wstr()) == 0) : false;
     };
 
     inline bool operator==(LPCWSTR s) const
@@ -247,12 +249,15 @@ public:
         if( notfound != iter )
         {
             VARTYPE vtype = V_VT(pVar);
-            VariantCopy(pVar, const_cast<VARIANTARG*>((*iter).second.variantArg()));
-            if( (V_VT(pVar) != vtype) && FAILED(VariantChangeType(pVar, pVar, 0, vtype)) )
+            VARIANTARG v;
+            VariantInit(&v);
+            VariantCopy(&v, const_cast<VARIANTARG*>((*iter).second.variantArg()));
+            if( (V_VT(&v) != vtype) && FAILED(VariantChangeType(&v, &v, 0, vtype)) )
             {
-                VariantClear(pVar);
+                VariantClear(&v);
                 return E_FAIL;
             }
+            *pVar = v;
             return S_OK;
         }
         else
@@ -400,7 +405,7 @@ private:
         return result;
     };
 
-    static HRESULT ReadProperty(LPSTREAM pStm, AxVLCPropertyPair **prop)
+    HRESULT ReadProperty(LPSTREAM pStm, AxVLCPropertyPair **prop)
     {
         HRESULT result;