Skip to content

Commit acc4040

Browse files
committed
avoid null pointer deref
1 parent 6603fe2 commit acc4040

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gfx/drivers/vulkan.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4264,8 +4264,14 @@ static bool vulkan_alive(void *data)
42644264
bool quit = false;
42654265
bool resize = false;
42664266
vk_t *vk = (vk_t*)data;
4267-
unsigned temp_width = vk->video_width;
4268-
unsigned temp_height = vk->video_height;
4267+
unsigned temp_width;
4268+
unsigned temp_height;
4269+
4270+
if (!vk)
4271+
return false;
4272+
4273+
temp_width = vk->video_width;
4274+
temp_height = vk->video_height;
42694275

42704276
vk->ctx_driver->check_window(vk->ctx_data,
42714277
&quit, &resize, &temp_width, &temp_height);

0 commit comments

Comments
 (0)