[FFmpeg-devel] [PATCH 2/3] avcodec/fft: Set potentially unused wrapper variables to avoid invalid free/uninit

Sebastian Ramacher sramacher at debian.org
Sun Nov 12 17:11:43 EET 2023


---
 libavcodec/avfft.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index 93203228c2..813b6d61a1 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -102,7 +102,8 @@ FFTContext *av_mdct_init(int nbits, int inverse, double scale)
             av_free(s);
             return NULL;
         }
-    }
+    } else
+        s->ctx2 = NULL;
 
     return (FFTContext *)s;
 }
@@ -220,7 +221,8 @@ DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
             av_free(s);
             return NULL;
         }
-    }
+    } else
+        s->tmp = NULL;
 
     return (DCTContext *)s;
 }
-- 
2.42.0



More information about the ffmpeg-devel mailing list