From: Sebastian Ramacher <sramacher@debian.org>
Date: Sun, 12 Nov 2023 17:46:28 +0000 (+0100)
Subject: avcoded/fft: Fix memory leak if ctx2 is used
X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/c7fe7ee8d4dcae510453abedabae53e45135144a?hp=af912d80d8880797bef9f2ba9809ecd84ed9acd9

avcoded/fft: Fix memory leak if ctx2 is used

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 250471ea1745fc703eb346a2a662304536a311b1)
---

diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index 3ef076d222..999b5ed79a 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -130,6 +130,7 @@ av_cold void av_mdct_end(FFTContext *s)
 {
     if (s) {
         AVTXWrapper *w = (AVTXWrapper *)s;
+        av_tx_uninit(&w->ctx2);
         av_tx_uninit(&w->ctx);
         av_free(w);
     }
