mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 23:13:18 +08:00
vo/opengl/context_drm_egl: init fd to -1
Instead of using zero initialized value. Otherwise an early init failure calls close(0), a descriptor we don't own, breaking whatever else happens to hold it. This is bit defensive, but I want to init those just after allocation, so we don't have to trace whether they are initalized correctly or not.
This commit is contained in:
@@ -562,6 +562,8 @@ static bool drm_egl_init(struct ra_ctx *ctx)
|
||||
goto err;
|
||||
|
||||
struct priv *p = ctx->priv = talloc_zero(ctx, struct priv);
|
||||
p->drm_params.fd = -1;
|
||||
p->drm_params.render_fd = -1;
|
||||
struct vo_drm_state *drm = ctx->vo->drm;
|
||||
|
||||
if (ctx->vo->drm->opts->draw_surface_size.wh_valid) {
|
||||
|
||||
Reference in New Issue
Block a user