mesa: fix segfault when no Mesa IR is generated
authorBryan Cain <bryancain3@gmail.com>
Sat, 30 Apr 2011 00:00:24 +0000 (19:00 -0500)
committerBryan Cain <bryancain3@gmail.com>
Mon, 1 Aug 2011 22:59:07 +0000 (17:59 -0500)
src/mesa/program/program.c

index 78efca9f122bb2b136073f21191a8655a67fbfdb..224446a2683489897326c53cabda7938df489c9a 100644 (file)
@@ -388,8 +388,9 @@ _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
    if (prog->String)
       free(prog->String);
 
-   _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
-
+   if (prog->Instructions) {
+      _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
+   }
    if (prog->Parameters) {
       _mesa_free_parameter_list(prog->Parameters);
    }