summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-03-06 05:26:13 +0100
committerMarek Olšák <[email protected]>2011-03-07 23:27:35 +0100
commitfb5d9e1199cabe653ae1bb822bb66ce9f0ce7f55 (patch)
treed76b5738ae84618bb29f87de7fcdd725baeceebe
parentdf818d572e4ddb1ceccd22a538bf98ce01caffee (diff)
st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails
This fixes: state_tracker/st_format.c:401:st_pipe_format_to_mesa_format: Assertion `0' failed.
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 5eda2346c60..ae49434cac9 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -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;