From 36394ab08dbf5aec9af6e2cc451a744275e33dfb Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 24 Jun 2017 09:14:46 -0700 Subject: [PATCH] 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. --- UI/window-basic-main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index aa47c3916..b38feba57 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -2774,7 +2774,8 @@ int OBSBasic::ResetVideo() ResizeProgram(ovi.base_width, ovi.base_height); } - OBSBasicStats::InitializeValues(); + if (ret == OBS_VIDEO_SUCCESS) + OBSBasicStats::InitializeValues(); return ret; }