draw: avoid overflows in the llvm draw loop
authorZack Rusin <zackr@vmware.com>
Mon, 24 Jun 2013 22:49:40 +0000 (18:49 -0400)
committerZack Rusin <zackr@vmware.com>
Tue, 25 Jun 2013 15:56:41 +0000 (11:56 -0400)
commitf96326b2f6713c21c8da9cb13d14f4842ff69578
treef472f8df7c3d156ec2306c2361bdb8da990ba1d9
parente2b02080d80aac26a7a596dfd6adb8ff9c5912ec
draw: avoid overflows in the llvm draw loop

Before we could easily overflow if start+count>max integer. To
avoid it we can just iterate over the count. This makes sure
that we never crash, since most of the overflow conditions
is already handled.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c