mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 14:50:07 +00:00
context_drm_egl: guard gbm_device on uninit
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.
This commit is contained in:
parent
4d80e7b72c
commit
e5d683e187
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user