auxiliary/draw: fix crash with zero-stride draw auto
authorRoland Scheidegger <sroland@vmware.com>
Wed, 15 May 2019 18:35:21 +0000 (20:35 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 16 May 2019 12:01:33 +0000 (14:01 +0200)
commit4171a26193e0d155f2e825b2f6e7d478932ddcf5
treec2dc60c677e47e6d9f1cc134f9168c298a3a90e2
parent22c1657d0552be0c558ca805c8d574e92f53c2cc
auxiliary/draw: fix crash with zero-stride draw auto

transform feedback draws get the number of vertices from the transform
feedback object. In draw, we'll figure this out with the number of bytes
written divided by the stride. However, it is apparently possible we end
up with a stride of 0 there (not entirely sure it could happen with GL).
Probably when nothing was actually ever written (so we don't actually
have a stride set). Just avoid the division by zero by setting the count
to 0.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_pt.c