diff options
| author | David Reid <mackron@gmail.com> | 2017-11-22 18:36:48 +1000 |
|---|---|---|
| committer | David Reid <mackron@gmail.com> | 2017-11-22 18:36:48 +1000 |
| commit | 8b3694a34d91682e05fb74f625bbd0f2dbb01645 (patch) | |
| tree | 95a1c7308adae54974f0796190a3424be8f0b38e /src | |
| parent | c71b01c8ac824f3c519ce181fc029d8d62102073 (diff) | |
| download | raylib-8b3694a34d91682e05fb74f625bbd0f2dbb01645.tar.gz raylib-8b3694a34d91682e05fb74f625bbd0f2dbb01645.zip | |
Fix a crash in audio mixing code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/audio.c b/src/audio.c index 2c2aedac..6065bf00 100644 --- a/src/audio.c +++ b/src/audio.c @@ -339,8 +339,8 @@ static mal_uint32 OnSendAudioDataToDevice(mal_device* pDevice, mal_uint32 frameC float tempBuffer[1024]; // 512 frames for stereo. mal_uint32 framesToReadRightNow = framesToRead; - if (framesToReadRightNow > sizeof(tempBuffer)/DEVICE_CHANNELS) { - framesToReadRightNow = sizeof(tempBuffer)/DEVICE_CHANNELS; + if (framesToReadRightNow > sizeof(tempBuffer)/sizeof(tempBuffer[0])/DEVICE_CHANNELS) { + framesToReadRightNow = sizeof(tempBuffer)/sizeof(tempBuffer[0])/DEVICE_CHANNELS; } // If we're not looping, we need to make sure we flush the internal buffers of the DSP pipeline to ensure we get the |
