From 1139a1b6acbe839826742992b2051500ff37f9f4 Mon Sep 17 00:00:00 2001 From: sephiroth99 Date: Thu, 4 Jun 2015 23:52:47 -0400 Subject: [PATCH] gl4: fix nullptr dereference in GL4Shader::CompileProgram A nullptr dereference will occur when the disassembly string is not found, which will obviously happen on AMD. Check for the condition and if it is not found, put a message indicating so. --- src/xenia/gpu/gl4/gl4_shader.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/gl4/gl4_shader.cc b/src/xenia/gpu/gl4/gl4_shader.cc index e2e20be14..798bd06c5 100644 --- a/src/xenia/gpu/gl4/gl4_shader.cc +++ b/src/xenia/gpu/gl4/gl4_shader.cc @@ -424,7 +424,11 @@ bool GL4Shader::CompileProgram(std::string source) { search_offset = p - search_start; ++search_offset; } - host_disassembly_ = std::string(disasm_start); + if (disasm_start) { + host_disassembly_ = std::string(disasm_start); + } else { + host_disassembly_ = std::string("Shader disassembly not available."); + } // Append to shader dump. if (FLAGS_dump_shaders.size()) {