mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-26 04:59:30 +08:00
vo/vulkan/context_display: 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:
@@ -377,6 +377,10 @@ static bool display_init(struct ra_ctx *ctx)
|
||||
|
||||
VkDisplayModePropertiesKHR *mode = NULL;
|
||||
|
||||
#if HAVE_DRM
|
||||
p->drm_params.fd = -1;
|
||||
p->drm_params.render_fd = -1;
|
||||
#endif
|
||||
p->opts = mp_get_config_group(p, ctx->global, &vulkan_display_conf);
|
||||
int display_idx = p->opts->display;
|
||||
int mode_idx = p->opts->mode;
|
||||
|
||||
Reference in New Issue
Block a user