From f35f663a1ba1373b62cf9c0ff6a1c2c17aaadb3f Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 31 Dec 2019 13:57:53 -0600 Subject: [PATCH] vrclient: Handle NULL texture argument to IVRRenderModels::LoadIntoTextureD3D11_Async --- vrclient_x64/vrclient_x64/vrclient_defs.h | 1 + vrclient_x64/vrclient_x64/vrclient_main.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/vrclient_x64/vrclient_x64/vrclient_defs.h b/vrclient_x64/vrclient_x64/vrclient_defs.h index 51d1d9ea..2eb599b0 100644 --- a/vrclient_x64/vrclient_x64/vrclient_defs.h +++ b/vrclient_x64/vrclient_x64/vrclient_defs.h @@ -298,6 +298,7 @@ typedef enum EVRRenderModelError VRRenderModelError_None = 0, VRRenderModelError_Loading = 100, VRRenderModelError_NotSupported = 200, + VRRenderModelError_InvalidArg = 300, VRRenderModelError_InvalidTexture = 400, } EVRRenderModelError; diff --git a/vrclient_x64/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_x64/vrclient_main.c index 89a27c28..591bb7f9 100644 --- a/vrclient_x64/vrclient_x64/vrclient_main.c +++ b/vrclient_x64/vrclient_x64/vrclient_main.c @@ -1215,6 +1215,9 @@ EVRRenderModelError ivrrendermodels_load_into_texture_d3d11_async( EVRRenderModelError error; ID3D11Texture2D *texture; + if (!dst_texture) + return VRRenderModelError_InvalidArg; + error = load_linux_texture_map(linux_side, texture_id, &texture_map, version); if (error == VRRenderModelError_Loading) {