Fix off-by-one error in DummyAudioProvider::GetAudio

Originally committed to SVN as r6102.
This commit is contained in:
Thomas Goyne 2011-12-22 21:25:29 +00:00
parent 0892de62a8
commit a5fce1d1be
1 changed files with 2 additions and 2 deletions

View File

@ -66,11 +66,11 @@ void DummyAudioProvider::GetAudio(void *buf, int64_t, int64_t count) const {
short *workbuf = (short*)buf;
if (noise) {
while (--count > 0)
while (count-- > 0)
*workbuf++ = (rand() - RAND_MAX/2) * 10000 / RAND_MAX;
}
else {
while (--count > 0)
while (count-- > 0)
*workbuf++ = 0;
}
}