diff --git a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp index 999bf8d902..039da4afab 100644 --- a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp @@ -494,6 +494,12 @@ public: if (status != noErr) return false; + if ((int) numFramesToRead < numThisTime) + { + numThisTime = (int) numFramesToRead; + numBytes = (size_t) numThisTime * sizeof (float); + } + for (int i = numDestChannels; --i >= 0;) { auto* dest = destSamples[(i < (int) numChannels ? channelMap[i] : i)];