Module: Mesa Branch: master Commit: 2c61b4db7d6f9ce2638bdd35c8dcac70ea950e4e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c61b4db7d6f9ce2638bdd35c8dcac70ea950e4e
Author: Axel Davy <[email protected]> Date: Tue May 28 22:47:44 2019 +0200 st/nine: Return error when setting invalid depth buffer Prevents a crash with the trace of https://github.com/iXit/wine-nine-standalone/issues/40 Signed-off-by: Axel Davy <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015> --- src/gallium/frontends/nine/device9.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/frontends/nine/device9.c b/src/gallium/frontends/nine/device9.c index 0d73965f2c4..841d62bc6ce 100644 --- a/src/gallium/frontends/nine/device9.c +++ b/src/gallium/frontends/nine/device9.c @@ -1929,6 +1929,9 @@ NineDevice9_SetDepthStencilSurface( struct NineDevice9 *This, struct NineSurface9 *ds = NineSurface9(pNewZStencil); DBG("This=%p pNewZStencil=%p\n", This, pNewZStencil); + user_assert(!ds || util_format_is_depth_or_stencil(ds->base.info.format), + D3DERR_INVALIDCALL); + if (This->state.ds != ds) { nine_bind(&This->state.ds, ds); nine_context_set_depth_stencil(This, ds); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
