diff mbox series

[FFmpeg-devel,139/217] avcodec/cook: Remove redundant free

Message ID 20201202042244.519127-5-andreas.rheinhardt@gmail.com
State Accepted
Commit 980f002b3f0b63d145918db98cea6bfc5abfc922
Headers show
Series [FFmpeg-devel,01/45] avcodec/a64multienc: Fix memleak upon init failure | expand

Checks

Context Check Description
andriy/x86 warning Failed to apply patch

Commit Message

Andreas Rheinhardt Dec. 2, 2020, 4:21 a.m. UTC
This decoder has the FF_CODEC_CAP_INIT_CLEANUP flag set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/cook.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 93c51f5829..f552a57415 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -236,10 +236,9 @@  static av_cold int init_cook_mlt(COOKContext *q)
         q->mlt_window[j] *= sqrt(2.0 / q->samples_per_channel);
 
     /* Initialize the MDCT. */
-    if ((ret = ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size) + 1, 1, 1.0 / 32768.0))) {
-        av_freep(&q->mlt_window);
+    ret = ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size) + 1, 1, 1.0 / 32768.0);
+    if (ret < 0)
         return ret;
-    }
     av_log(q->avctx, AV_LOG_DEBUG, "MDCT initialized, order = %d.\n",
            av_log2(mlt_size) + 1);