mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-27 22:42:09 +00:00
Prevent hang in S_UpdateBackgroundTrack() with some sample rates.
Fixes Bugzilla #4022.
This commit is contained in:
parent
6978dcf645
commit
b9f033d1fa
1 changed files with 3 additions and 0 deletions
|
@ -1374,6 +1374,9 @@ void S_UpdateBackgroundTrack( void ) {
|
||||||
// decide how much data needs to be read from the file
|
// decide how much data needs to be read from the file
|
||||||
fileSamples = bufferSamples * s_backgroundStream->info.rate / dma.speed;
|
fileSamples = bufferSamples * s_backgroundStream->info.rate / dma.speed;
|
||||||
|
|
||||||
|
if (!fileSamples)
|
||||||
|
return;
|
||||||
|
|
||||||
// our max buffer size
|
// our max buffer size
|
||||||
fileBytes = fileSamples * (s_backgroundStream->info.width * s_backgroundStream->info.channels);
|
fileBytes = fileSamples * (s_backgroundStream->info.width * s_backgroundStream->info.channels);
|
||||||
if ( fileBytes > sizeof(raw) ) {
|
if ( fileBytes > sizeof(raw) ) {
|
||||||
|
|
Loading…
Reference in a new issue