sink_stream: Resolve heap buffer corruption due to out of bounds write

Also, remove the use of ScratchBuffer when upmixing, as other channels may not be initialized with zeroed out data.
This commit is contained in:
Morph 2023-06-30 00:54:23 -04:00
parent 5b4cceec9b
commit 885090dc13
2 changed files with 20 additions and 17 deletions

View file

@ -16,7 +16,6 @@
#include "common/polyfill_thread.h"
#include "common/reader_writer_queue.h"
#include "common/ring_buffer.h"
#include "common/scratch_buffer.h"
#include "common/thread.h"
namespace Core {
@ -256,8 +255,6 @@ private:
/// Signalled when ring buffer entries are consumed
std::condition_variable_any release_cv;
std::mutex release_mutex;
/// Temporary buffer for appending samples when upmixing
Common::ScratchBuffer<s16> tmp_samples{};
};
using SinkStreamPtr = std::unique_ptr<SinkStream>;