X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=snd_mem.c;h=108aa7795599f903ff15fcd7991c0bd3111ed3c4;hb=9e3db0fc7835fee2178c2ce677fcc98d8fda449f;hp=777dd6c6652b3c9769c4d99d1d374ba4601fc98c;hpb=da29a8beeb35293e2fd38b51883c91b5cf4cf4ad;p=xonotic%2Fdarkplaces.git diff --git a/snd_mem.c b/snd_mem.c index 777dd6c6..108aa779 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -80,7 +80,7 @@ snd_buffer_t *Snd_CreateSndBuffer (const unsigned char *samples, unsigned int sa { size_t newsampleframes, memsize; snd_buffer_t* sb; - + newsampleframes = (double)sampleframes * (double)sb_speed / (double)in_format->speed; memsize = newsampleframes * in_format->channels * in_format->width; @@ -311,6 +311,7 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) return true; // If we weren't able to load it previously, no need to retry + // Note: S_PrecacheSound clears this flag to cause a retry if (sfx->flags & SFXFLAG_FILEMISSING) return false; @@ -331,7 +332,7 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (S_LoadWavFile (namebuffer, sfx)) return true; if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav")) - strcpy (namebuffer + len - 3, "ogg"); + memcpy (namebuffer + len - 3, "ogg", 4); if (OGG_LoadVorbisFile (namebuffer, sfx)) return true; } @@ -347,7 +348,7 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (S_LoadWavFile (namebuffer, sfx)) return true; if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav")) - strcpy (namebuffer + len - 3, "ogg"); + memcpy (namebuffer + len - 3, "ogg", 4); if (OGG_LoadVorbisFile (namebuffer, sfx)) return true;