mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Fix crash bug in new codec audio loader, thanks brain for reporting
This commit is contained in:
parent
c65234328a
commit
68338a8268
1 changed files with 1 additions and 26 deletions
|
@ -26,31 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
static snd_codec_t *codecs;
|
||||
|
||||
/*
|
||||
=================
|
||||
S_FileExtension
|
||||
=================
|
||||
*/
|
||||
static char *S_FileExtension(const char *fni)
|
||||
{
|
||||
// we should search from the ending to the last '/'
|
||||
|
||||
char *fn = (char *) fni + strlen(fni) - 1;
|
||||
char *eptr = NULL;
|
||||
|
||||
while(*fn != '/' && fn != fni)
|
||||
{
|
||||
if(*fn == '.')
|
||||
{
|
||||
eptr = fn;
|
||||
break;
|
||||
}
|
||||
fn--;
|
||||
}
|
||||
|
||||
return eptr;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
S_CodecGetSound
|
||||
|
@ -71,7 +46,7 @@ static void *S_CodecGetSound(const char *filename, snd_info_t *info)
|
|||
|
||||
Q_strncpyz(localName, filename, MAX_QPATH);
|
||||
|
||||
ext = S_FileExtension(localName);
|
||||
ext = COM_GetExtension(localName);
|
||||
|
||||
if( *ext )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue