Mesa (master): mesa: Add missing null check in _mesa_parse_arb_program()
Tapani Pälli
tpalli at kemper.freedesktop.org
Wed Apr 2 16:56:23 UTC 2014
Module: Mesa
Branch: master
Commit: 17e7cbe078dc2d3556208212d07afe72489aae33
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=17e7cbe078dc2d3556208212d07afe72489aae33
Author: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Date: Wed Apr 2 16:13:58 2014 +0300
mesa: Add missing null check in _mesa_parse_arb_program()
Add missing null check in program_parse.tab.c through
program_parse.y
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
---
src/mesa/program/program_parse.y | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 6dde69d..1664740 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -2749,6 +2749,11 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st
*/
state->prog->Instructions =
_mesa_alloc_instructions(state->prog->NumInstructions + 1);
+
+ if (state->prog->Instructions == NULL) {
+ goto error;
+ }
+
inst = state->inst_head;
for (i = 0; i < state->prog->NumInstructions; i++) {
struct asm_instruction *const temp = inst->next;
More information about the mesa-commit
mailing list