From 021cd56bc98aec220b85c2049e1edb5c02714294 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Wed, 27 Mar 2019 14:59:00 -0400 Subject: Permit a Null Shader in case of a bad host_ptr. --- src/video_core/renderer_opengl/gl_shader_cache.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 1f8eca6f0..a9d88000e 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -41,6 +41,10 @@ GPUVAddr GetShaderAddress(Maxwell::ShaderProgram program) { /// Gets the shader program code from memory for the specified address ProgramCode GetShaderCode(const u8* host_ptr) { ProgramCode program_code(VideoCommon::Shader::MAX_PROGRAM_LENGTH); + ASSERT_OR_EXECUTE(host_ptr != nullptr, { + std::fill(program_code.begin(), program_code.end(), 0); + return program_code; + }); std::memcpy(program_code.data(), host_ptr, program_code.size() * sizeof(u64)); return program_code; } -- cgit v1.2.3