Explorar o código

win-capture: Fix potentially uninitialized vars

jp9000 %!s(int64=11) %!d(string=hai) anos
pai
achega
e2ee8adf77

+ 2 - 4
plugins/win-capture/duplicator-monitor-capture.c

@@ -203,20 +203,18 @@ static void duplicator_capture_render(void *data, gs_effect_t *effect)
 		gs_enable_color(true, true, true, false);
 
 		if (rot != 0) {
-			float x;
-			float y;
+			float x = 0.0f;
+			float y = 0.0f;
 
 			switch (rot) {
 			case 90:
 				x = (float)capture->height;
-				y = 0.0f;
 				break;
 			case 180:
 				x = (float)capture->width;
 				y = (float)capture->height;
 				break;
 			case 270:
-				x = 0.0f;
 				y = (float)capture->width;
 				break;
 			}

+ 3 - 3
plugins/win-capture/graphics-hook/d3d9-capture.cpp

@@ -455,9 +455,9 @@ static void d3d9_init(IDirect3DDevice9 *device)
 {
 	IDirect3DDevice9Ex *d3d9ex = nullptr;
 	bool success;
-	uint32_t cx;
-	uint32_t cy;
-	HWND window;
+	uint32_t cx = 0;
+	uint32_t cy = 0;
+	HWND window = nullptr;
 	HRESULT hr;
 
 	data.d3d9 = get_system_module("d3d9.dll");