engine: soundlib: fix slashes in Sound_GetApproxWavePlayLen, as it can be called from game DLL
This commit is contained in:
parent
0df89bddeb
commit
64166c7d82
1 changed files with 5 additions and 1 deletions
|
@ -95,12 +95,16 @@ byte *Sound_Copy( size_t size )
|
||||||
|
|
||||||
uint GAME_EXPORT Sound_GetApproxWavePlayLen( const char *filepath )
|
uint GAME_EXPORT Sound_GetApproxWavePlayLen( const char *filepath )
|
||||||
{
|
{
|
||||||
|
string name;
|
||||||
file_t *f;
|
file_t *f;
|
||||||
wavehdr_t wav;
|
wavehdr_t wav;
|
||||||
size_t filesize;
|
size_t filesize;
|
||||||
uint msecs;
|
uint msecs;
|
||||||
|
|
||||||
f = FS_Open( filepath, "rb", false );
|
Q_strncpy( name, filepath, sizeof( filepath ));
|
||||||
|
COM_FixSlashes( name );
|
||||||
|
|
||||||
|
f = FS_Open( name, "rb", false );
|
||||||
if( !f )
|
if( !f )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue