nouveau: nv30: check number of colour buffers to bind
authorPatrice Mandin <patmandin@gmail.com>
Wed, 21 Oct 2009 19:56:09 +0000 (21:56 +0200)
committerPatrice Mandin <patmandin@gmail.com>
Wed, 21 Oct 2009 19:56:09 +0000 (21:56 +0200)
src/gallium/drivers/nv30/nv30_state_fb.c

index 9b0266f..197de82 100644 (file)
@@ -17,6 +17,10 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
        struct nv30_miptree *nv30mt;
        int colour_bits = 32, zeta_bits = 32;
 
+       if (fb->nr_cbufs == 0) {
+               return FALSE;
+       }
+
        rt_enable = 0;
        for (i = 0; i < fb->nr_cbufs; i++) {
                if (colour_format) {