Skip to content

Commit 7bf2d9c

Browse files
committed
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.
1 parent 318e4e2 commit 7bf2d9c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

video/out/opengl/context_drm_egl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ static bool drm_egl_init(struct ra_ctx *ctx)
562562
goto err;
563563

564564
struct priv *p = ctx->priv = talloc_zero(ctx, struct priv);
565+
p->drm_params.fd = -1;
566+
p->drm_params.render_fd = -1;
565567
struct vo_drm_state *drm = ctx->vo->drm;
566568

567569
if (ctx->vo->drm->opts->draw_surface_size.wh_valid) {

0 commit comments

Comments
 (0)