History

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.

Dudemanguy committed 2 years ago

Commit e5d683e1 parent 4d80e7b1 file · +2 −1Browse files

Unified · Split

video/out/opengl/context_drm_egl.c+2−1
@@ -491,7 +491,8 @@ static void drm_egl_uninit(struct ra_ctx *ctx) · 490 unmodified lines
491 if (p->gbm.surface)491 if (p->gbm.surface)
492 gbm_surface_destroy(p->gbm.surface);492 gbm_surface_destroy(p->gbm.surface);
493 eglTerminate(p->egl.display);493 eglTerminate(p->egl.display);
494 gbm_device_destroy(p->gbm.device);494 if (p->gbm.device)
495 gbm_device_destroy(p->gbm.device);
495 496
496 if (p->drm_params.render_fd != -1)497 if (p->drm_params.render_fd != -1)
497 close(p->drm_params.render_fd);498 close(p->drm_params.render_fd);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t