From 9df2f0c64f43685a540b155230e4c913d70b43cb Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Fri, 7 Feb 2020 07:55:59 -0500 Subject: [PATCH] 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. --- src/common/shaderloader.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/shaderloader.hpp b/src/common/shaderloader.hpp index 71e63ff..470bfcf 100644 --- a/src/common/shaderloader.hpp +++ b/src/common/shaderloader.hpp @@ -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.