From 8c1db978b89ed23a6e5f3c7c10ac2382e2085882 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 21 Apr 2020 09:41:22 -0400 Subject: [PATCH] - fixed: hwrenderer materials were nullptr checked but the pointers were not always properly initialized --- src/common/textures/hw_material.h | 2 +- src/rendering/hwrenderer/scene/hw_renderstate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/textures/hw_material.h b/src/common/textures/hw_material.h index f6311c962..ee752c1f4 100644 --- a/src/common/textures/hw_material.h +++ b/src/common/textures/hw_material.h @@ -47,7 +47,7 @@ class FMaterial bool TrimBorders(uint16_t *rect); public: - FTexture *tex; + FTexture *tex = nullptr; FTexture *sourcetex; // in case of redirection this is different from tex. FMaterial(FTexture *tex, bool forceexpand); diff --git a/src/rendering/hwrenderer/scene/hw_renderstate.h b/src/rendering/hwrenderer/scene/hw_renderstate.h index 6ec91b6c3..c20898169 100644 --- a/src/rendering/hwrenderer/scene/hw_renderstate.h +++ b/src/rendering/hwrenderer/scene/hw_renderstate.h @@ -90,7 +90,7 @@ struct FStateVec4 struct FMaterialState { - FMaterial *mMaterial; + FMaterial *mMaterial = nullptr; int mClampMode; int mTranslation; int mOverrideShader;