diff mbox series

[FFmpeg-devel,21/25] avfilter/af_headphone: Avoid allocating array

Message ID 20200908211856.16290-21-andreas.rheinhardt@gmail.com
State Accepted
Commit 6ada3c83681de138ab8371c5ded1c8a7a0f9d370
Headers show
Series [FFmpeg-devel,01/25] avfilter/af_headphone: Don't use uninitialized buffer in log message | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 8, 2020, 9:18 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavfilter/af_headphone.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Paul B Mahol Sept. 9, 2020, 1:07 a.m. UTC | #1
On Tue, Sep 08, 2020 at 11:18:52PM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/af_headphone.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 

ok
diff mbox series

Patch

diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index bbbe32a475..2d2b57d819 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -79,7 +79,7 @@  typedef struct HeadphoneContext {
     struct hrir_inputs {
         int          ir_len;
         int          eof;
-    } *hrir_in;
+    } hrir_in[64];
     uint64_t mapping[64];
 } HeadphoneContext;
 
@@ -654,10 +654,6 @@  static av_cold int init(AVFilterContext *ctx)
 
     parse_map(ctx);
 
-    s->hrir_in = av_calloc(s->nb_hrir_inputs, sizeof(*s->hrir_in));
-    if (!s->hrir_in)
-        return AVERROR(ENOMEM);
-
     for (i = 0; i < s->nb_hrir_inputs; i++) {
         char *name = av_asprintf("hrir%d", i);
         AVFilterPad pad = {
@@ -721,7 +717,6 @@  static av_cold void uninit(AVFilterContext *ctx)
     av_freep(&s->data_hrtf[1]);
     av_freep(&s->fdsp);
 
-    av_freep(&s->hrir_in);
     for (unsigned i = 1; i < ctx->nb_inputs; i++)
         av_freep(&ctx->input_pads[i].name);
 }