int len;
float stepscale;
sfxcache_t *sc;
- byte stackbuf[1*1024]; // avoid dirtying the cache heap
// see if still in memory
sc = Cache_Check (&s->cache);
// Con_Printf ("loading %s\n",namebuffer);
- data = COM_LoadStackFile(namebuffer, stackbuf, sizeof(stackbuf), false);
+ data = COM_LoadMallocFile(namebuffer, false);
if (!data)
{
if (info.channels < 1 || info.channels > 2)
{
Con_Printf ("%s has an unsupported number of channels (%i)\n",s->name, info.channels);
+ qfree(data);
return NULL;
}
/*
sc = Cache_Alloc ( &s->cache, len + sizeof(sfxcache_t), s->name);
if (!sc)
+ {
+ qfree(data);
return NULL;
+ }
sc->length = info.samples;
sc->loopstart = info.loopstart;
ResampleSfx (s, sc->speed, data + info.dataofs);
+ qfree(data);
return sc;
}