From 5f290c5b117a7aa4c48c27ba9268412288aa4139 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sun, 15 Dec 2013 10:12:44 +0100 Subject: [PATCH] Audio: Prevent div-by-zero --- src/audio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/audio.cpp b/src/audio.cpp index 34fbc40..3aa69bd 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -1071,7 +1071,8 @@ private: ALint size = AL::Buffer::getSize(buf); ALint chan = AL::Buffer::getChannels(buf); - procFrames += ((size / (bits / 8)) / chan); + if (bits != 0 && chan != 0) + procFrames += ((size / (bits / 8)) / chan); } if (sourceExhausted)