From a7026ca6d37a6ab63c8652fdcc538beb60240b10 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Wed, 15 Feb 2023 21:17:41 -0800 Subject: Externals/FreeSurround: Fix pointer created through new[] being freed via delete Doing so is not allowed (presumably because compilers are allowed to use a different algorithm for allocating between the two/store extra data such as the length of the array before the pointer). This bug existed in the original implementation at https://web.archive.org/web/20140708092159/http://www.hydrogenaud.io/forums/index.php?showtopic=52235 and causes Valgrind to emit a warning. Note that this ended up happening even if DSPLLE and the DPL decoder are not enabled in Dolphin. --- Externals/FreeSurround/source/FreeSurroundDecoder.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Externals/FreeSurround/source/FreeSurroundDecoder.cpp') diff --git a/Externals/FreeSurround/source/FreeSurroundDecoder.cpp b/Externals/FreeSurround/source/FreeSurroundDecoder.cpp index b65734a5cb..10b45ff753 100644 --- a/Externals/FreeSurround/source/FreeSurroundDecoder.cpp +++ b/Externals/FreeSurround/source/FreeSurroundDecoder.cpp @@ -31,10 +31,8 @@ DPL2FSDecoder::DPL2FSDecoder() { } DPL2FSDecoder::~DPL2FSDecoder() { -#pragma warning(suppress : 4150) - delete forward; -#pragma warning(suppress : 4150) - delete inverse; + kiss_fftr_free(forward); + kiss_fftr_free(inverse); } void DPL2FSDecoder::Init(channel_setup chsetup, unsigned int blsize, -- cgit v1.2.3