mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-13 18:40:02 +01:00
New take on CVE-2018-17097 i.e. avoiding writing beyond end of buffer in case of 24-bit samples
This commit is contained in:
parent
6d700259b9
commit
7f594f8b7d
@ -924,8 +924,7 @@ void WavOutFile::write(const float *buffer, int numElems)
|
||||
|
||||
bytesPerSample = header.format.bits_per_sample / 8;
|
||||
numBytes = numElems * bytesPerSample;
|
||||
int confBufBytes = (numBytes + 3) & -4; // round up to nearest multiple of four to avoid overflow with 24bit-value assignment
|
||||
void *temp = getConvBuffer(confBufBytes);
|
||||
void *temp = getConvBuffer(numBytes + 7); // round bit up to avoid buffer overrun with 24bit-value assignment
|
||||
|
||||
switch (bytesPerSample)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user