[vlc-commits] [Git][videolan/vlc][master] 3 commits: egl_gbm: fix use-after-free in logging
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jan 26 11:42:49 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
9d21d25c by Alexandre Janniaux at 2024-01-26T11:10:38+00:00
egl_gbm: fix use-after-free in logging
- - - - -
85f8fe67 by Alexandre Janniaux at 2024-01-26T11:10:38+00:00
egl_gbm: fix leaks of wayland objects
- - - - -
c2ee0776 by Alexandre Janniaux at 2024-01-26T11:10:38+00:00
qt: compositor_wayland_module: fix leaks of wayland objects
- - - - -
2 changed files:
- modules/gui/qt/maininterface/compositor_wayland_module.c
- modules/video_output/opengl/egl_gbm.c
Changes:
=====================================
modules/gui/qt/maininterface/compositor_wayland_module.c
=====================================
@@ -165,6 +165,9 @@ static void Close(qtwayland_t* obj)
{
qtwayland_priv_t* sys = (qtwayland_priv_t*)(obj->p_sys);
wl_display_flush(sys->display);
+
+ wl_subcompositor_destroy(sys->subcompositor);
+ wl_compositor_destroy(sys->compositor);
wl_event_queue_destroy(sys->queue);
}
@@ -198,8 +201,16 @@ static bool Init(qtwayland_t* obj, void* qpni_display)
return true;
error:
+ if (sys->subcompositor)
+ wl_subcompositor_destroy(sys->subcompositor);
+ if (sys->compositor)
+ wl_compositor_destroy(sys->compositor);
if (sys->queue)
wl_event_queue_destroy(sys->queue);
+ sys->compositor = NULL;
+ sys->subcompositor = NULL;
+ sys->queue = NULL;
+
return false;
}
=====================================
modules/video_output/opengl/egl_gbm.c
=====================================
@@ -392,13 +392,14 @@ static bool OpenDrmDevice(vlc_gl_t* gl, drmDevice* device)
msg_Dbg(gl, "open drm device %s", render_node);
int fd = vlc_open(render_node, O_RDWR);
- free(render_node);
if (fd < 0)
{
msg_Err(gl, "can't open drm device %s", render_node);
+ free(render_node);
return false;
}
+ free(render_node);
sys->gbm.device = gbm_create_device(fd);
return sys->gbm.device != NULL;
@@ -599,6 +600,12 @@ static void ReleaseDisplay(vlc_gl_t* gl)
{
vlc_gl_sys_t* sys = gl->sys;
+ if (sys->wayland.feedback != NULL)
+ zwp_linux_dmabuf_feedback_v1_destroy(sys->wayland.feedback);
+
+ if (sys->wayland.dmabuf != NULL)
+ zwp_linux_dmabuf_v1_destroy(sys->wayland.dmabuf);
+
if (sys->gbm.device)
{
int fd = gbm_device_get_fd(sys->gbm.device);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5dcc5ff839b2b115aed35e9ead1f65d902ba820c...c2ee077679f3a03d2fc7f90e9bcd24f26f4aafbd
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5dcc5ff839b2b115aed35e9ead1f65d902ba820c...c2ee077679f3a03d2fc7f90e9bcd24f26f4aafbd
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list