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:
1 parent
318e4e21fb
commit
7bf2d9cee6
1 file changed
+2
@@ -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