win-capture: Fix possible null pointer dereference

master
jp9000 2016-12-23 02:01:09 -08:00
parent bd67c18c02
commit 4fe2ca0f75
1 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,10 @@ HWND find_window(enum window_search_mode mode,
HWND window = first_window(mode, &parent);
HWND best_window = NULL;
int best_rating = 0;
if (!class)
return NULL;
bool uwp_window = strcmp(class, "Windows.UI.Core.CoreWindow") == 0;
while (window) {