aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/convolution.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-08-27 21:32:25 -0700
committerChris Robinson <[email protected]>2020-08-27 21:32:25 -0700
commita9ebcdcb7fb2d8eeb137b54c100f3d9601b71a2e (patch)
tree6c453c4739ee87eb6edbfa4c4ed6fc4a72dbf2f2 /alc/effects/convolution.cpp
parent0ad7bb577a008209c04a9fafc9b981262c6f3692 (diff)
Handle 0-length convolution buffers
Diffstat (limited to 'alc/effects/convolution.cpp')
-rw-r--r--alc/effects/convolution.cpp3
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;