diff mbox

[FFmpeg-devel] ffplay: fix memleak in audio_thread

Message ID CADxeRwmZ-VbNc78JsVHksHcquK0EFp0r3gM5P3nE+QmFA_R3Ew@mail.gmail.com
State Rejected
Headers show

Commit Message

Steven Liu Sept. 2, 2016, 7:09 a.m. UTC
ffplay: fix memleak in audio_thread

Signed-off-by: LiuQi <liuqi@gosun.com>
---
 ffplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.7.4 (Apple Git-66)

Comments

Marton Balint Sept. 2, 2016, 8:43 p.m. UTC | #1
On Fri, 2 Sep 2016, Steven Liu wrote:

> ffplay: fix memleak in audio_thread
>
> Signed-off-by: LiuQi <liuqi@gosun.com>
> ---
> ffplay.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ffplay.c b/ffplay.c
> index adbe9cb..d7f7200 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -2127,7 +2127,7 @@ static int audio_thread(void *arg)
>
>                 av_frame_move_ref(af->frame, frame);
>                 frame_queue_push(&is->sampq);
> -
> +                av_frame_unref(frame);

Why is this a mem leak? The av_frame_move_ref call should clear 
everything in frame, if that is not the case, then I think the 
bug is deeper within the API.

Regards,
Marton
diff mbox

Patch

diff --git a/ffplay.c b/ffplay.c
index adbe9cb..d7f7200 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2127,7 +2127,7 @@  static int audio_thread(void *arg)

                 av_frame_move_ref(af->frame, frame);
                 frame_queue_push(&is->sampq);
-
+                av_frame_unref(frame);
 #if CONFIG_AVFILTER
                 if (is->audioq.serial != is->auddec.pkt_serial)
                     break;