mesa: Add missing null check in _mesa_parse_arb_program()
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Wed, 2 Apr 2014 13:13:58 +0000 (16:13 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 2 Apr 2014 16:54:37 +0000 (19:54 +0300)
Add missing null check in program_parse.tab.c through
program_parse.y

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/program/program_parse.y

index 6dde69d537296293306baf8b1f1aeaafae64de54..1664740b431fee2aeaa5ef73fb2b36a5c4b3d239 100644 (file)
@@ -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;