Audio: Prevent div-by-zero

This commit is contained in:
Jonas Kulla 2013-12-15 10:12:44 +01:00
parent 8161b00804
commit 5f290c5b11
1 changed files with 2 additions and 1 deletions

View File

@ -1071,7 +1071,8 @@ private:
ALint size = AL::Buffer::getSize(buf); ALint size = AL::Buffer::getSize(buf);
ALint chan = AL::Buffer::getChannels(buf); ALint chan = AL::Buffer::getChannels(buf);
procFrames += ((size / (bits / 8)) / chan); if (bits != 0 && chan != 0)
procFrames += ((size / (bits / 8)) / chan);
} }
if (sourceExhausted) if (sourceExhausted)