Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix startup segfault #1

Open
wants to merge 1 commit into from

1 participant

joequant
joequant

This patch fixes a startup segfault in free orion. If there is no shader, FO creates an object with a NULL shading programming. Binding a variable to this NULL shader will cause a segfault on AMD.

The fix keeps the shared pointer null if there is no shader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 15, 2013
  1. joequant

    fix startup segfault

    joequant authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 FreeOrion/UI/MapWnd.cpp
6 FreeOrion/UI/MapWnd.cpp
View
@@ -1928,8 +1928,10 @@ void MapWnd::InitTurnRendering() {
boost::filesystem::path shader_path = GetRootDataDir() / "default" / "shaders" / "scanlines.frag";
std::string shader_text;
ReadFile(shader_path, shader_text);
- m_scanline_shader = boost::shared_ptr<ShaderProgram>(
- ShaderProgram::shaderProgramFactory("", shader_text));
+ if (!shader_text.empty())
+ m_scanline_shader =
+ boost::shared_ptr<ShaderProgram>(
+ ShaderProgram::shaderProgramFactory("", shader_text));
}
// adjust size of map window for universe and application size
Something went wrong with that request. Please try again.