[Datatype-cvs] wm/common parse_asf_objects.cpp,1.4.4.3,1.4.4.4

[Datatype-cvs] wm/common parse_asf_objects.cpp,1.4.4.3,1.4.4.4

anshuman at helixcommunity.org anshuman at helixcommunity.org
Sun May 4 23:10:30 PDT 2008


Update of /cvsroot/datatype/wm/common
In directory cvs.internal.helixcommunity.org:/tmp/cvs-serv15525

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	parse_asf_objects.cpp 
Log Message:
Using wide character pointer instead of BYTE pointer fixes the issue as it allows only even addesses to be assigned to metadata string pointer

Index: parse_asf_objects.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/common/parse_asf_objects.cpp,v
retrieving revision 1.4.4.3
retrieving revision 1.4.4.4
diff -u -d -r1.4.4.3 -r1.4.4.4
--- parse_asf_objects.cpp	7 Aug 2007 21:32:30 -0000	1.4.4.3
+++ parse_asf_objects.cpp	5 May 2008 06:10:28 -0000	1.4.4.4
@@ -204,7 +204,9 @@
                 if (pszTmp)
                 {
                     // Convert to ASCII
-                    HLXOsStrW cStr((const wchar_t*) *ppBuf, ulNumWideChar);
+                    wchar_t* pTmpWChar = new wchar_t[ulNumWideChar];
+                    memcpy((BYTE*) pTmpWChar,  *ppBuf,  ulNumWideChar*sizeof(wchar_t));
+                    HLXOsStrW cStr((const wchar_t*) pTmpWChar, ulNumWideChar);					
                     // Copy the string
                     strncpy(pszTmp, (const char*) cStr, ulNumWideChar);
                     // NULL terminate the string
@@ -214,6 +216,7 @@
                     *pulLen -= ulByteSize;
                     // Assign the out parameter
                     *ppszOut = pszTmp;
+                    delete [] pTmpWChar;
                     // Clear the return value
                     retVal = HXR_OK;
                 }




More information about the Datatype-cvs mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.