svga: Check if Stencil buffer is NULL
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Fixes a nullptr dereference on older HW versions.

Fixes: f29d939824 ("svga: rework framebuffer state")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38623>
This commit is contained in:
Ian Forbes 2025-11-24 10:12:25 -06:00 committed by Marge Bot
parent 67d05f71e9
commit 4e16a5b68b

View file

@ -84,7 +84,7 @@ emit_fb_vgpu9(struct svga_context *svga)
if (svga_surface_needs_propagation(hwfb->zsbuf))
svga_propagate_surface(svga, hwfb->zsbuf, true);
if (currfb->zsbuf->base.texture &&
if (currfb->zsbuf && currfb->zsbuf->base.texture &&
util_format_is_depth_and_stencil(currfb->zsbuf->base.format)) {
ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_STENCIL,
currfb->zsbuf);