r300g: fix possible crash when shader compilation fails
authorMarek Olšák <maraeo@gmail.com>
Wed, 14 Apr 2010 18:23:15 +0000 (20:23 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 14 Apr 2010 18:29:42 +0000 (20:29 +0200)
This hopefully fixes the crash in the FDO bug #27634, not the bug itself.

src/gallium/drivers/r300/r300_fs.c
src/gallium/drivers/r300/r300_vs.c

index 8da0796e70fc0a4d9492d1b4955727d56661d1b5..3cddf98675a88a8749d5112ea0be35dbab3c248d 100644 (file)
@@ -278,7 +278,10 @@ static void r300_translate_fragment_shader(
                     "Giving up...\n");
             abort();
         }
+
+        rc_destroy(&compiler.Base);
         r300_dummy_fragment_shader(r300, shader);
+        return;
     }
 
     /* Initialize numbers of constants for each type. */
index 8137972f0188a989207fd9a029d809156732d731..bfab9c3b014bfe553990eb637c47495c50348456 100644 (file)
@@ -330,7 +330,10 @@ void r300_translate_vertex_shader(struct r300_context* r300,
                     "Giving up...\n");
             abort();
         }
+
+        rc_destroy(&compiler.Base);
         r300_dummy_vertex_shader(r300, vs);
+        return;
     }
 
     /* Initialize numbers of constants for each type. */