Commit c3486cd8 authored by Erik Faye-Lund 's avatar Erik Faye-Lund

st/mesa: do not call update_framebuffer_size with NULL pointer

In st_renderbuffer_alloc_storage, we avoid allocating storage for
zero-sized buffers, leading to this pointer being NULL. We already
take care to avoid dereferencing these pointers for color-buffers,
but not for depth/stencil-buffers.

So let's thread a bit more carefully here.

This avoids a crash while running Piglit's glx/glx-visuals-stencil
test, both on virgl and r600g.
Signed-off-by: Erik Faye-Lund 's avatarErik Faye-Lund <>
Reviewed-by: default avatarGuillaume Charifi <>
Reviewed-by: default avatarMarek Olšák <>
parent dd333c66
......@@ -181,7 +181,8 @@ st_update_framebuffer_state( struct st_context *st )
st_update_renderbuffer_surface(st, strb);
framebuffer.zsbuf = strb->surface;
update_framebuffer_size(&framebuffer, strb->surface);
if (strb->surface)
update_framebuffer_size(&framebuffer, strb->surface);
framebuffer.zsbuf = NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment