Browse Source

UI: Fix potential crash with unsupported video cards

If a video card is unsupported, it will attempt to initialize the stats
window, querying values from a video subsystem that doesn't exist, and
crash instead of alerting the user that their hardware is unsupported.
jp9000 8 years ago
parent
commit
36394ab08d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      UI/window-basic-main.cpp

+ 2 - 1
UI/window-basic-main.cpp

@@ -2774,7 +2774,8 @@ int OBSBasic::ResetVideo()
 			ResizeProgram(ovi.base_width, ovi.base_height);
 			ResizeProgram(ovi.base_width, ovi.base_height);
 	}
 	}
 
 
-	OBSBasicStats::InitializeValues();
+	if (ret == OBS_VIDEO_SUCCESS)
+		OBSBasicStats::InitializeValues();
 
 
 	return ret;
 	return ret;
 }
 }