From: divverent Date: Tue, 26 Jun 2007 20:25:58 +0000 (+0000) Subject: fix buffer overrun in vorbis decoder X-Git-Tag: xonotic-v0.1.0preview~3011 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=6a7922a15331ef5065c7637a04d2c78a076f840c;p=xonotic%2Fdarkplaces.git fix buffer overrun in vorbis decoder git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7453 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_ogg.c b/snd_ogg.c index 1b4b148f..9016656f 100644 --- 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