mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 09:57:34 +00:00
context_drm_egl: don't free egl properties if they are null
If we failed to create a gbm surface, we would call drm_egl_uninit to free up any state we had allocated. However, we would segfault if we tried to cleanup properties there were never initialized. Null checks have been added to guard against this.
This commit is contained in:
parent
2791eb64e8
commit
19384e07e4
@ -497,8 +497,11 @@ static void drm_egl_uninit(struct ra_ctx *ctx)
|
||||
|
||||
eglMakeCurrent(p->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||
EGL_NO_CONTEXT);
|
||||
if (p->egl.display) {
|
||||
eglDestroyContext(p->egl.display, p->egl.context);
|
||||
eglDestroySurface(p->egl.display, p->egl.surface);
|
||||
}
|
||||
if (p->gbm.surface)
|
||||
gbm_surface_destroy(p->gbm.surface);
|
||||
eglTerminate(p->egl.display);
|
||||
gbm_device_destroy(p->gbm.device);
|
||||
|
Loading…
Reference in New Issue
Block a user