From a9ebcdcb7fb2d8eeb137b54c100f3d9601b71a2e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 27 Aug 2020 21:32:25 -0700 Subject: Handle 0-length convolution buffers --- alc/effects/convolution.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'alc/effects') 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; -- cgit v1.2.3