summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-04-18 14:57:01 -0500
committerDudemanguy <random342@airmail.cc>2024-04-18 14:57:01 -0500
commite5d683e187d1e67fcfc944769a7c31cfcc2d0491 (patch)
treece44be24306ad13fa73677607c8d24de9452a470 /video/out/opengl
parent4d80e7b72c0a4094f918779359fcce38eb796c40 (diff)
downloadmpv-master.tar.bz2
mpv-master.tar.xz
context_drm_egl: guard gbm_device on uninitHEADmaster
Not all cards support gbm which means the creation of the gbm device will fail. However during the uninit process, the destruction of the device was unconditionally done which leads to a segfault. Guard it instead. Fixes #13929.
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/context_drm_egl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c
index ce86570efe..da28093562 100644
--- a/video/out/opengl/context_drm_egl.c
+++ b/video/out/opengl/context_drm_egl.c
@@ -491,7 +491,8 @@ static void drm_egl_uninit(struct ra_ctx *ctx)
if (p->gbm.surface)
gbm_surface_destroy(p->gbm.surface);
eglTerminate(p->egl.display);
- gbm_device_destroy(p->gbm.device);
+ if (p->gbm.device)
+ gbm_device_destroy(p->gbm.device);
if (p->drm_params.render_fd != -1)
close(p->drm_params.render_fd);