From 0dc0e6490cd5eac701a1821cdc007e0aecbc228f Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 3 Jan 2020 17:29:07 +1100 Subject: [PATCH] [c-host] dxgi: check for failure of getDesc1 --- VERSION | 2 +- c-host/platform/Windows/capture/DXGI/src/dxgi.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 27e5a749..bbd1b1ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-50-g49bf115c84+1 \ No newline at end of file +B1-51-g127113a59b+1 \ No newline at end of file diff --git a/c-host/platform/Windows/capture/DXGI/src/dxgi.c b/c-host/platform/Windows/capture/DXGI/src/dxgi.c index e6974606..623a6bb5 100644 --- a/c-host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/c-host/platform/Windows/capture/DXGI/src/dxgi.c @@ -240,7 +240,12 @@ static bool dxgi_init(void * pointerShape, const unsigned int pointerSize) if (optAdapter) { DXGI_ADAPTER_DESC1 adapterDesc; - IDXGIAdapter1_GetDesc1(this->adapter, &adapterDesc); + status = IDXGIAdapter1_GetDesc1(this->adapter, &adapterDesc); + if (FAILED(status)) + { + DEBUG_WINERROR("Failed to get the device description", status); + goto fail; + } const size_t s = (wcslen(adapterDesc.Description)+1) * 2; char * desc = malloc(s);