[Mesa-dev] [PATCH 06/11] glsl: add missing null check in tfeedback_decl::init()
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Fri Apr 4 03:28:00 PDT 2014
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
src/glsl/link_varyings.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index c925c00..d0a9d75 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -278,6 +278,12 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx,
const char *base_name_end;
long subscript = parse_program_resource_name(input, &base_name_end);
this->var_name = ralloc_strndup(mem_ctx, input, base_name_end - input);
+
+ if (this->var_name == NULL) {
+ _mesa_error_no_memory(__FUNCTION__);
+ return;
+ }
+
if (subscript >= 0) {
this->array_subscript = subscript;
this->is_subscripted = true;
--
1.8.1.2
More information about the mesa-dev
mailing list