From 0ad7bb577a008209c04a9fafc9b981262c6f3692 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 27 Aug 2020 21:10:00 -0700 Subject: Don't allow callback buffers for effect slots --- al/auxeffectslot.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 790db24f..5b2a7f44 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -453,9 +453,13 @@ START_API_FUNC { buffer = LookupBuffer(device, static_cast(value)); if(!buffer) SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid buffer ID"); + if(buffer->Callback) + SETERR_RETURN(context, AL_INVALID_OPERATION,, + "Callback buffer not valid for effects"); + + IncrementRef(buffer->ref); } - if(buffer) IncrementRef(buffer->ref); if(ALbuffer *oldbuffer{slot->Buffer}) DecrementRef(oldbuffer->ref); slot->Buffer = buffer; -- cgit v1.2.3