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:
1 parent
33111f3212
commit
f6df7dfd8b
1 file changed
+4
@@ -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