st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails
authorMarek Olšák <maraeo@gmail.com>
Sun, 6 Mar 2011 04:26:13 +0000 (05:26 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 7 Mar 2011 22:27:35 +0000 (23:27 +0100)
This fixes:
  state_tracker/st_format.c:401:st_pipe_format_to_mesa_format:
  Assertion `0' failed.

src/mesa/state_tracker/st_cb_fbo.c

index 5eda2346c60ca8b71f218e7fc2d86dfd52c72e6c..ae49434cac934a4a99584e613e7d11056bc2d655 100644 (file)
@@ -79,7 +79,11 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
    else
       format = st_choose_renderbuffer_format(screen, internalFormat,
                                              rb->NumSamples);
-      
+
+   if (format == PIPE_FORMAT_NONE) {
+      return FALSE;
+   }
+
    /* init renderbuffer fields */
    strb->Base.Width  = width;
    strb->Base.Height = height;