[Mesa-dev] [PATCH 13/36] st/nine: Avoid crash on empty Draw*Up

Axel Davy axel.davy at ens.fr
Wed Dec 7 22:30:36 UTC 2016


Ignore empty draw calls.
Avoid assertion fault when such draw calls happen
in u_upload_mgr.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/gallium/state_trackers/nine/device9.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 8b03e9b..ddac548 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -3023,6 +3023,7 @@ NineDevice9_DrawPrimitiveUP( struct NineDevice9 *This,
 
     user_assert(pVertexStreamZeroData && VertexStreamZeroStride,
                 D3DERR_INVALIDCALL);
+    user_assert(PrimitiveCount, D3D_OK);
 
     nine_update_state(This);
 
@@ -3089,6 +3090,7 @@ NineDevice9_DrawIndexedPrimitiveUP( struct NineDevice9 *This,
     user_assert(VertexStreamZeroStride, D3DERR_INVALIDCALL);
     user_assert(IndexDataFormat == D3DFMT_INDEX16 ||
                 IndexDataFormat == D3DFMT_INDEX32, D3DERR_INVALIDCALL);
+    user_assert(PrimitiveCount, D3D_OK);
 
     nine_update_state(This);
 
-- 
2.10.2



More information about the mesa-dev mailing list