aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-02 15:29:26 -0800
committerChris Robinson <[email protected]>2018-12-02 15:29:26 -0800
commit45b65366bb2ba6c11756e2509589e310b9f0df88 (patch)
tree5525a1c5f3bdc9d850e75036415c8e562489d406 /Alc
parent60254488e9faa2934e9d261328a3c0359056bdd0 (diff)
Improve some checks for compiler analysis
Diffstat (limited to 'Alc')
-rw-r--r--Alc/mixvoice.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp
index fdff0eca..d19a4861 100644
--- a/Alc/mixvoice.cpp
+++ b/Alc/mixvoice.cpp
@@ -482,7 +482,8 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize
ALsizei CompLen{0};
auto load_buffer = [pos,&SrcData,NumChannels,SampleSize,chan,FilledAmt,SizeToDo,&CompLen](const ALbuffer *buffer) -> void
{
- ALsizei DataSize{buffer ? buffer->SampleLen : 0};
+ if(!buffer) return;
+ ALsizei DataSize{buffer->SampleLen};
if(pos >= DataSize) return;
DataSize = mini(SizeToDo, DataSize - pos);