diff mbox series

[FFmpeg-devel] avdevice/v4l2: fix leak of timefilter

Message ID tencent_E46115C0890EAEAE054B5305C841F3F43305@qq.com
State Accepted
Commit 30aa0c3f4873a92c5e3da8ba8cf030de56bf4cf7
Headers show
Series [FFmpeg-devel] avdevice/v4l2: fix leak of timefilter | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Zhao Zhili July 26, 2022, 4:32 p.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

Fixes ticket #9844.
---
I don't have a camera for test. So I'm not sure if it's the only case
of memleak in ticket #9844.

 libavdevice/v4l2.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Anton Khirnov Aug. 2, 2022, 11:10 a.m. UTC | #1
Quoting Zhao Zhili (2022-07-26 18:32:51)
> From: Zhao Zhili <zhilizhao@tencent.com>
> 
> Fixes ticket #9844.
> ---
> I don't have a camera for test. So I'm not sure if it's the only case
> of memleak in ticket #9844.
> 
>  libavdevice/v4l2.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index 5340382d57..be422d7c8c 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -1011,6 +1011,7 @@ static int v4l2_read_close(AVFormatContext *ctx)
>  
>      mmap_close(s);
>  
> +    ff_timefilter_destroy(s->timefilter);

Tested, works, LGTM
diff mbox series

Patch

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 5340382d57..be422d7c8c 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -1011,6 +1011,7 @@  static int v4l2_read_close(AVFormatContext *ctx)
 
     mmap_close(s);
 
+    ff_timefilter_destroy(s->timefilter);
     v4l2_close(s->fd);
     return 0;
 }