Fix case where shader type from file is unknown

The variable was previously uninitialized, so the value may not have
necessarily been zero for the comparison that follows.
This commit is contained in:
Kienan Stewart 2020-02-07 07:55:59 -05:00
parent d481aa4d19
commit 9df2f0c64f
1 changed files with 3 additions and 0 deletions

View File

@ -200,6 +200,9 @@ int loadShadersFromFile(const char* file_path, struct ShaderRegistry *registry)
else if(strcmp("geometry", type) == 0) {
shader_type = geometry;
}
else {
shader_type = 0;
}
if(shader_type == 0) {
// Invalid line, unknown type.