diff mbox series

[FFmpeg-devel,PATCHv2,1/2] avcodec/fft: Use av_mallocz to avoid invalid free/uninit

Message ID 20231112174628.2701654-1-sramacher@debian.org
State Accepted
Commit a562cfee2e214252f8b3f516527272ae32ef9532
Headers show
Series [FFmpeg-devel,PATCHv2,1/2] avcodec/fft: Use av_mallocz to avoid invalid free/uninit | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Sebastian Ramacher Nov. 12, 2023, 5:46 p.m. UTC
---
 libavcodec/avfft.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index fb635abfff..3ef076d222 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -46,7 +46,7 @@  FFTContext *av_fft_init(int nbits, int inverse)
 {
     int ret;
     float scale = 1.0f;
-    AVTXWrapper *s = av_malloc(sizeof(*s));
+    AVTXWrapper *s = av_mallocz(sizeof(*s));
     if (!s)
         return NULL;
 
@@ -85,7 +85,7 @@  FFTContext *av_mdct_init(int nbits, int inverse, double scale)
 {
     int ret;
     float scale_f = scale;
-    AVTXWrapper *s = av_malloc(sizeof(*s));
+    AVTXWrapper *s = av_mallocz(sizeof(*s));
     if (!s)
         return NULL;
 
@@ -146,7 +146,7 @@  RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans)
     if (trans != IDFT_C2R && trans != DFT_R2C)
         return NULL;
 
-    s = av_malloc(sizeof(*s));
+    s = av_mallocz(sizeof(*s));
     if (!s)
         return NULL;
 
@@ -199,7 +199,7 @@  DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
         [DST_I] = AV_TX_FLOAT_DST_I,
     };
 
-    AVTXWrapper *s = av_malloc(sizeof(*s));
+    AVTXWrapper *s = av_mallocz(sizeof(*s));
     if (!s)
         return NULL;