]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix buffer overrun in vorbis decoder
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 Jun 2007 20:25:58 +0000 (20:25 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 Jun 2007 20:25:58 +0000 (20:25 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7453 d7cf8633-e32d-0410-b094-e92efae38249

snd_ogg.c

index 1b4b148f600cd37c9132af79d5bc98cc58c470ba..9016656f9d361c68cca3b4c9a27b9b9d5e2be51a 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -546,6 +546,8 @@ static const snd_buffer_t* OGG_FetchSound (channel_t* ch, unsigned int* start, u
                return NULL;
        }
        newlength = per_sfx->format.speed * factor;  // -> 1 sec of sound before resampling
+       if(newlength > sizeof(resampling_buffer))
+               newlength = sizeof(resampling_buffer);
 
        // Decompress in the resampling_buffer
 #if BYTE_ORDER == BIG_ENDIAN