[FFmpeg-devel,v2] libavfilter/vf_cover_rect.c: free the allocated frame

Submitted by lance.lmwang@gmail.com on June 7, 2019, 10:32 p.m.

Details

Message ID 1559946758-39636-1-git-send-email-lance.lmwang@gmail.com
State New
Headers show

Commit Message

lance.lmwang@gmail.com June 7, 2019, 10:32 p.m.
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavfilter/vf_cover_rect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

mypopy@gmail.com June 10, 2019, 10:22 a.m.
On Sat, Jun 8, 2019 at 6:58 AM <lance.lmwang@gmail.com> wrote:
>
> From: Limin Wang <lance.lmwang@gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavfilter/vf_cover_rect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c
> index 41cd1a1..ac0f684 100644
> --- a/libavfilter/vf_cover_rect.c
> +++ b/libavfilter/vf_cover_rect.c
> @@ -197,7 +197,7 @@ static av_cold void uninit(AVFilterContext *ctx)
>      CoverContext *cover = ctx->priv;
>
>      if (cover->cover_frame)
> -        av_freep(&cover->cover_frame->data[0]);
> +        av_frame_free(&cover->cover_frame);
>  }
>
>  static av_cold int init(AVFilterContext *ctx)
> --
av_frame_free have check the NULL pointer, so does not need to check
cover->cover_frame if use this function.

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c
index 41cd1a1..ac0f684 100644
--- a/libavfilter/vf_cover_rect.c
+++ b/libavfilter/vf_cover_rect.c
@@ -197,7 +197,7 @@  static av_cold void uninit(AVFilterContext *ctx)
     CoverContext *cover = ctx->priv;
 
     if (cover->cover_frame)
-        av_freep(&cover->cover_frame->data[0]);
+        av_frame_free(&cover->cover_frame);
 }
 
 static av_cold int init(AVFilterContext *ctx)