From 6f81d6f492c54273eaf162026450d06f32ad4839 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Wed, 16 Mar 2022 19:27:46 +0900 Subject: [PATCH] e_video_hwc: fix leak of the E_Comp_Wl_Video_Buf If the committed_vbuf is changed before it is set to the current_fb, in_use flag of vbuf is not changed to false and vbuf is not freed in _e_comp_wl_video_buffer_free() fucntion. This patch fixes leak of the E_Comp_Wl_Video_Buf in this case Change-Id: Id844c6109688f676154d959c7d2cc9538f6beefc --- src/bin/video/iface/e_video_hwc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/video/iface/e_video_hwc.c b/src/bin/video/iface/e_video_hwc.c index 3489d40..c217498 100644 --- a/src/bin/video/iface/e_video_hwc.c +++ b/src/bin/video/iface/e_video_hwc.c @@ -737,6 +737,12 @@ _e_video_hwc_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf) * tdm driver. */ e_pixmap_image_clear(evh->ec->pixmap, EINA_TRUE); + if ((evh->committed_vbuf) && (evh->committed_vbuf != evh->current_fb)) + { + e_comp_wl_video_buffer_set_use(evh->committed_vbuf, EINA_FALSE); + e_comp_wl_buffer_reference(&evh->committed_vbuf->buffer_ref, NULL); + } + evh->committed_vbuf = vbuf; if (!_e_video_hwc_can_commit(evh)) -- 2.7.4