From f9eb06a22e2983367954a204e00baae194a6aaed Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 28 Jan 2017 00:13:27 -0500 Subject: [PATCH] - fixed: If GLRenderer is uninitialized (i.e. using software renderer, or during startup), gl_paltonemap_* CVARs would crash the game. --- src/gl/renderer/gl_postprocess.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index c504088f4..72121d338 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -135,12 +135,14 @@ CUSTOM_CVAR(Float, gl_ssao_exponent, 1.8f, 0) CUSTOM_CVAR(Float, gl_paltonemap_powtable, 2.0f, CVAR_ARCHIVE | CVAR_NOINITCALL) { - GLRenderer->ClearTonemapPalette(); + if (GLRenderer) + GLRenderer->ClearTonemapPalette(); } CUSTOM_CVAR(Bool, gl_paltonemap_reverselookup, true, CVAR_ARCHIVE | CVAR_NOINITCALL) { - GLRenderer->ClearTonemapPalette(); + if (GLRenderer) + GLRenderer->ClearTonemapPalette(); }