From bf35b5495703e5dd8eca54b04927ef3781f18219 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 24 Jan 2019 00:07:36 +0100 Subject: [PATCH] gs-rendertarget: Don't ignore failed creation of render target --- source/gs-rendertarget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/gs-rendertarget.cpp b/source/gs-rendertarget.cpp index 6f8c614..5115181 100644 --- a/source/gs-rendertarget.cpp +++ b/source/gs-rendertarget.cpp @@ -45,6 +45,9 @@ gs::rendertarget::rendertarget(gs_color_format colorFormat, gs_zstencil_format z obs_enter_graphics(); render_target = gs_texrender_create(colorFormat, zsFormat); obs_leave_graphics(); + if (!render_target) { + throw std::runtime_error("Failed to create render target."); + } } gs::rendertarget_op gs::rendertarget::render(uint32_t width, uint32_t height)