aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-09-15 06:19:04 +0000
committericculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-09-15 06:19:04 +0000
commit354953a21db9a9d4a6661a599d3956d693428816 (patch)
tree0a1d4fa42b0f4bcc0147aac92830a774300b0943
parentb908a71b0bcb9249c3b89022b388f92833e92bb1 (diff)
downloadioquake3-aero-354953a21db9a9d4a6661a599d3956d693428816.tar.gz
ioquake3-aero-354953a21db9a9d4a6661a599d3956d693428816.zip
Prevent hang in S_UpdateBackgroundTrack() with some sample rates.
Fixes Bugzilla #4022. git-svn-id: svn://svn.icculus.org/quake3/trunk@1622 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r--code/client/snd_dma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/code/client/snd_dma.c b/code/client/snd_dma.c
index a8ce121..cb8bfb9 100644
--- a/code/client/snd_dma.c
+++ b/code/client/snd_dma.c
@@ -1374,6 +1374,9 @@ void S_UpdateBackgroundTrack( void ) {
// decide how much data needs to be read from the file
fileSamples = bufferSamples * s_backgroundStream->info.rate / dma.speed;
+ if (!fileSamples)
+ return;
+
// our max buffer size
fileBytes = fileSamples * (s_backgroundStream->info.width * s_backgroundStream->info.channels);
if ( fileBytes > sizeof(raw) ) {