From 21a17620e37dce28295cbc43b692d7fe910efd67 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 3 Jan 2019 15:54:18 -0800 Subject: Fix the ringbuffer write limit Previously it just limited the returned write space, irrespective of how much had already been written. The buffer could still be filled up by doing multiple writes. Now the size is limited by adjusting the read pointer by the real vs limited difference when calculating the writable space. --- Alc/ringbuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Alc/ringbuffer.h') diff --git a/Alc/ringbuffer.h b/Alc/ringbuffer.h index 317995b0..311477c9 100644 --- a/Alc/ringbuffer.h +++ b/Alc/ringbuffer.h @@ -26,7 +26,7 @@ using ll_ringbuffer_data_pair = std::pair struct RingBuffer { std::atomic mWritePtr{0u}; std::atomic mReadPtr{0u}; - size_t mSize{0u}; + size_t mWriteSize{0u}; size_t mSizeMask{0u}; size_t mElemSize{0u}; -- cgit v1.2.3