engine: soundlib: fix slashes in Sound_GetApproxWavePlayLen, as it can be called from game DLL

This commit is contained in:
Alibek Omarov 2023-08-18 11:46:48 +03:00
parent 0df89bddeb
commit 64166c7d82
1 changed files with 5 additions and 1 deletions

View File

@ -95,12 +95,16 @@ byte *Sound_Copy( size_t size )
uint GAME_EXPORT Sound_GetApproxWavePlayLen( const char *filepath )
{
string name;
file_t *f;
wavehdr_t wav;
size_t filesize;
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 )
return 0;