[FFmpeg-devel,V1,1/5] lavfi/af_adeclick: fix double free after ff_filter_frame fail

Submitted by Jun Zhao on Aug. 19, 2019, 1:01 p.m.

Details

Message ID 1566219667-22805-1-git-send-email-mypopydev@gmail.com
State Accepted
Commit df6876d69172140eb315a914a924abece2c6481a
Headers show

Commit Message

Jun Zhao Aug. 19, 2019, 1:01 p.m.
From: Jun Zhao <barryjzhao@tencent.com>

ff_filter_frame fail will free the frame, so we just returen after this
function fail.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavfilter/af_adeclick.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Paul B Mahol Aug. 19, 2019, 1:14 p.m.
LGTM

On Mon, Aug 19, 2019 at 3:08 PM Jun Zhao <mypopydev@gmail.com> wrote:

> From: Jun Zhao <barryjzhao@tencent.com>
>
> ff_filter_frame fail will free the frame, so we just returen after this
> function fail.
>
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
>  libavfilter/af_adeclick.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavfilter/af_adeclick.c b/libavfilter/af_adeclick.c
> index 50eef74..2c42f97 100644
> --- a/libavfilter/af_adeclick.c
> +++ b/libavfilter/af_adeclick.c
> @@ -592,7 +592,7 @@ static int filter_frame(AVFilterLink *inlink)
>
>      ret = ff_filter_frame(outlink, out);
>      if (ret < 0)
> -        goto fail;
> +        return ret;
>
>      if (s->samples_left > 0) {
>          s->samples_left -= s->hop_size;
> --
> 1.7.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
mypopy@gmail.com Aug. 20, 2019, 2:02 a.m.
On Mon, Aug 19, 2019 at 9:14 PM Paul B Mahol <onemda@gmail.com> wrote:
>
> LGTM
>
Will apply, Thanks

Patch hide | download patch | download mbox

diff --git a/libavfilter/af_adeclick.c b/libavfilter/af_adeclick.c
index 50eef74..2c42f97 100644
--- a/libavfilter/af_adeclick.c
+++ b/libavfilter/af_adeclick.c
@@ -592,7 +592,7 @@  static int filter_frame(AVFilterLink *inlink)
 
     ret = ff_filter_frame(outlink, out);
     if (ret < 0)
-        goto fail;
+        return ret;
 
     if (s->samples_left > 0) {
         s->samples_left -= s->hop_size;