OSDN Git Service

draw: fix crashes with out-of-bounds indices
authorRoland Scheidegger <sroland@vmware.com>
Fri, 2 Nov 2012 15:48:49 +0000 (16:48 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 15 Nov 2012 17:37:06 +0000 (17:37 +0000)
commit94f9ea03a12fe1adf90c0e5defb0063cd568b537
treedadb894a7c54d1cb75dca940ec7e1843100ae9a2
parent3893593732b07c91543530392f44f57fe343d8c4
draw: fix crashes with out-of-bounds indices

The passthrough pipeline needs to check index values (which might be passed
through) as they can be invalid (which causes crashes and various assertion
failures if the clip code runs). Obviously, rendering won't be well-defined,
but those bogus indices might come directly from apps.
There were already debug printfs which reported the out-of-bounds indices but
we really ought to not crash.
While checking at that point doesn't seem like the most efficient solution,
it seems there isn't really another appropriate function to do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_pipe.c
src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h