diff options
author | Chris Robinson <[email protected]> | 2020-08-27 21:32:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-08-27 21:32:25 -0700 |
commit | a9ebcdcb7fb2d8eeb137b54c100f3d9601b71a2e (patch) | |
tree | 6c453c4739ee87eb6edbfa4c4ed6fc4a72dbf2f2 | |
parent | 0ad7bb577a008209c04a9fafc9b981262c6f3692 (diff) |
Handle 0-length convolution buffers
-rw-r--r-- | alc/effects/convolution.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index 8213113b..2ebb9f51 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -136,6 +136,9 @@ EffectBufferBase *ConvolutionState::createBuffer(const ALCdevice *device, const al::byte *sampleData, ALuint sampleRate, FmtType sampleType, FmtChannels channelType, ALuint numSamples) { + /* An empty buffer doesn't need a convolution filter. */ + if(numSamples < 1) return nullptr; + /* FIXME: Support anything. */ if(channelType != FmtMono && channelType != FmtStereo) return nullptr; |