From 6c6c2f1d23b02491c60e0cbce6815b468ff14c08 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 18 Oct 2008 09:55:54 -0600 Subject: gallium: add some checks for null surface pointers in state tracker Fixes some segfaults in low memory situations. --- src/mesa/state_tracker/st_atom_framebuffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/state_tracker/st_atom_framebuffer.c') diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 80df3b0506..2916886610 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -118,9 +118,10 @@ update_framebuffer_state( struct st_context *st ) update_renderbuffer_surface(st, strb); } - assert(strb->surface); - framebuffer->cbufs[framebuffer->num_cbufs] = strb->surface; - framebuffer->num_cbufs++; + if (strb->surface) { + framebuffer->cbufs[framebuffer->num_cbufs] = strb->surface; + framebuffer->num_cbufs++; + } } } @@ -132,7 +133,6 @@ update_framebuffer_state( struct st_context *st ) update_renderbuffer_surface(st, strb); } - assert(strb->surface); framebuffer->zsbuf = strb->surface; } else { -- cgit v1.2.3