vblank: fix use of uninitialized variables

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-02-18 19:36:20 +00:00
parent 3bac1d8845
commit 9e5e6ae99b
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 3 additions and 3 deletions

View File

@ -118,19 +118,19 @@ static void *sgi_video_sync_thread(void *data) {
auto self = args->self;
Display *dpy = XOpenDisplay(NULL);
int error_code = 0;
GLXContext ctx = NULL;
GLXDrawable drawable = None;
Window root = DefaultRootWindow(dpy), dummy = None;
if (!dpy) {
error_code = 1;
goto start_failed;
}
Window root = DefaultRootWindow(dpy), dummy = None;
int screen = DefaultScreen(dpy);
int ncfg = 0;
GLXFBConfig *cfg_ = glXChooseFBConfig(
dpy, screen,
(int[]){GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, 0},
&ncfg);
GLXContext ctx = NULL;
GLXDrawable drawable = None;
if (!cfg_) {
error_code = 2;