Fix crash bug in new codec audio loader, thanks brain for reporting

This commit is contained in:
Thilo Schulz 2011-05-12 10:53:36 +00:00
parent c65234328a
commit 68338a8268
1 changed files with 1 additions and 26 deletions

View File

@ -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 )
{