mesa: check for null shader->InfoLog before printing
authorBrian Paul <brianp@vmware.com>
Thu, 12 Aug 2010 21:57:54 +0000 (15:57 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 12 Aug 2010 22:00:01 +0000 (16:00 -0600)
src/mesa/program/prog_print.c

index 1ce1bf2f4ed3cae67ac74c917d172ebb070b2210..95db9b0eb341f8ab5883b90dbe0318bbb41dfc38 100644 (file)
@@ -1032,7 +1032,9 @@ _mesa_write_shader_to_file(const struct gl_shader *shader)
    fprintf(f, "/* Compile status: %s */\n",
            shader->CompileStatus ? "ok" : "fail");
    fprintf(f, "/* Log Info: */\n");
-   fputs(shader->InfoLog, f);
+   if (shader->InfoLog) {
+      fputs(shader->InfoLog, f);
+   }
    if (shader->CompileStatus && shader->Program) {
       fprintf(f, "/* GPU code */\n");
       fprintf(f, "/*\n");