From: Axel Davy Date: Sun, 23 Oct 2016 20:27:30 +0000 (+0200) Subject: st/nine: Avoid crash on empty Draw*Up X-Git-Tag: android-x86-6.0-r3~1116 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e7a0f580a6029845b372504388b5b5d2eed2c55b;p=android-x86%2Fexternal-mesa.git st/nine: Avoid crash on empty Draw*Up Ignore empty draw calls. Avoid assertion fault when such draw calls happen in u_upload_mgr. Signed-off-by: Axel Davy --- diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 8b03e9bc033..ddac548418f 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);