[FFmpeg-devel] avfilter/drawtext: stop resource leak

Submitted by Gyan on May 15, 2019, 7:12 a.m.

Details

Message ID 15676ccb-311e-d10e-aba7-08ce40791c9d@gyani.pro
State Accepted
Commit 8cf947ca4c603f14cdb016eff0c341cb37ec09cc
Headers show

Commit Message

Gyan May 15, 2019, 7:12 a.m.
See http://www.ffmpeg.org/pipermail/ffmpeg-devel/2019-May/244029.html

Gyan
From 22f3b816e8da13877872a2e6ac408fc32de7d561 Mon Sep 17 00:00:00 2001
From: Gyan Doshi <ffmpeg@gyani.pro>
Date: Wed, 15 May 2019 12:36:05 +0530
Subject: [PATCH] avfilter/drawtext: stop resource leak

Fixes Coverity CID 1445099
---
 libavfilter/vf_drawtext.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol May 15, 2019, 11:43 a.m.
On 5/15/19, Gyan <ffmpeg@gyani.pro> wrote:
>
> See http://www.ffmpeg.org/pipermail/ffmpeg-devel/2019-May/244029.html
>
> Gyan
>

probably ok
Gyan May 16, 2019, 5:13 a.m.
On 15-05-2019 05:13 PM, Paul B Mahol wrote:
> On 5/15/19, Gyan <ffmpeg@gyani.pro> wrote:
>> See http://www.ffmpeg.org/pipermail/ffmpeg-devel/2019-May/244029.html
>>
>> Gyan
>>
> probably ok
Pushed as 8cf947ca4c603f14cdb016eff0c341cb37ec09cc

Thanks,
Gyan

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index b166574d71..01cd7fa122 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -894,7 +894,7 @@  static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char
 
         ctx->priv = old;
         uninit(ctx);
-        av_freep(old);
+        av_freep(&old);
 
         ctx->priv = new;
         return config_input(ctx->inputs[0]);
@@ -903,7 +903,7 @@  static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char
 
 fail:
     av_log(ctx, AV_LOG_ERROR, "Failed to process command. Continuing with existing parameters.\n");
-    av_freep(new);
+    av_freep(&new);
     return ret;
 }