File soundtouch-round-buffer.patch of Package soundtouch.9661
From 09e04252dde9ef02a7d254315b13089996afe302 Mon Sep 17 00:00:00 2001
From 7f594f8b7d10bbc16a4a31de8ec5a279af9c7378 Mon Sep 17 00:00:00 2001
From: Olli <oparviai@iki.fi>
Date: Wed, 31 Oct 2018 18:36:05 +0200
Subject: [PATCH] Fix CVE-2018-17097 by rounding working buffer size.
---
source/SoundStretch/WavFile.cpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Index: soundtouch/source/SoundStretch/WavFile.cpp
===================================================================
--- soundtouch.orig/source/SoundStretch/WavFile.cpp
+++ soundtouch/source/SoundStretch/WavFile.cpp
@@ -893,7 +893,7 @@ void WavOutFile::write(const float *buff
bytesPerSample = header.format.bits_per_sample / 8;
numBytes = numElems * bytesPerSample;
- short *temp = (short*)getConvBuffer(numBytes);
+ void *temp = getConvBuffer(numBytes + 7); // round bit up to avoid buffer overrun with 24bit-value assignment
switch (bytesPerSample)
{