aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/program_parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/program/program_parse.y')
-rw-r--r--mesalib/src/mesa/program/program_parse.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesalib/src/mesa/program/program_parse.y b/mesalib/src/mesa/program/program_parse.y
index 6dde69d53..1664740b4 100644
--- a/mesalib/src/mesa/program/program_parse.y
+++ b/mesalib/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;