e_video_hwc: fix leak of the E_Comp_Wl_Video_Buf 79/272479/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 16 Mar 2022 10:27:46 +0000 (19:27 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 17 Mar 2022 09:20:48 +0000 (18:20 +0900)
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

index 3489d40..c217498 100644 (file)
@@ -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))