Browse Source

win-capture: Fix possible null pointer dereference

jp9000 9 years ago
parent
commit
4fe2ca0f75
1 changed files with 4 additions and 0 deletions
  1. 4 0
      plugins/win-capture/window-helpers.c

+ 4 - 0
plugins/win-capture/window-helpers.c

@@ -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) {