diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-10-03 12:44:07 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-10-03 16:30:36 +0200 |
commit | 532a4dcba6ec6fe1bd88f3c2db77f05868167886 (patch) | |
tree | 82857bab5b8914677e0d17a4b668dfcb97b0467e /avmedia | |
parent | 372d2d78906aac32ddaf7eaa3c2037ea3d5af1ae (diff) |
Replace more reinterpret_cast with SAL_W/SAL_U
Change-Id: Ia632e4083222ad9e7f17c2ad0d0825f189c700cc
Reviewed-on: https://gerrit.libreoffice.org/43071
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/win/framegrabber.cxx | 7 | ||||
-rw-r--r-- | avmedia/source/win/player.cxx | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/avmedia/source/win/framegrabber.cxx b/avmedia/source/win/framegrabber.cxx index ce24b96f7ad2..e6c808787bee 100644 --- a/avmedia/source/win/framegrabber.cxx +++ b/avmedia/source/win/framegrabber.cxx @@ -78,8 +78,13 @@ IMediaDet* implCreateMediaDet( const OUString& rURL ) if( osl::FileBase::getSystemPathFromFileURL( rURL, aLocalStr ) == osl::FileBase::E_None ) { - if( !SUCCEEDED( pDet->put_Filename( ::SysAllocString( reinterpret_cast<LPCOLESTR>(aLocalStr.getStr()) ) ) ) ) + BSTR bstrFilename = SysAllocString(SAL_W(aLocalStr.getStr())); + if( !SUCCEEDED( pDet->put_Filename( bstrFilename ) ) ) { + // Shouldn't we free this string unconditionally, not only in case of failure? + // I cannot find information why do we pass a newly allocated BSTR to the put_Filename + // and if it frees the string internally + SysFreeString(bstrFilename); pDet->Release(); pDet = nullptr; } diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index 268babd1b17c..6ecb6a261ecc 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -148,7 +148,7 @@ bool Player::create( const OUString& rURL ) // It disables the desktop composition as soon as RenderFile is called // also causes some other problems: video rendering is not reliable - if( SUCCEEDED( hR = mpGB->RenderFile( reinterpret_cast<LPCWSTR>(rURL.getStr()), nullptr ) ) && + if( SUCCEEDED( hR = mpGB->RenderFile( SAL_W(rURL.getStr()), nullptr ) ) && SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaControl, reinterpret_cast<void**>(&mpMC) ) ) && SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaEventEx, reinterpret_cast<void**>(&mpME) ) ) && SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaSeeking, reinterpret_cast<void**>(&mpMS) ) ) && |