translate: fix buffer overflows
authorZack Rusin <zackr@vmware.com>
Tue, 4 Mar 2014 04:09:58 +0000 (23:09 -0500)
committerZack Rusin <zackr@vmware.com>
Tue, 4 Mar 2014 20:56:04 +0000 (15:56 -0500)
commit1dd84357ec8d6894ec6bbd7040a8e8328015cd16
treec60fe0c84816a98afa14c095267fac3b79bcc39c
parent08f174daa41b89c41a87c350f407307e2ba258eb
translate: fix buffer overflows

Because in draw we always inject position at slot 0 whenever
fragment shader would take the maximum number of inputs (32) it
meant that we had PIPE_MAX_ATTRIBS + 1 slots to translate, which
meant that we were crashing with fragment shaders that took
the maximum number of attributes as inputs. The actual max number
of attributes we need to translate thus is PIPE_MAX_ATTRIBS + 1.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
src/gallium/auxiliary/translate/translate.h
src/gallium/auxiliary/translate/translate_cache.c
src/gallium/auxiliary/translate/translate_generic.c
src/gallium/auxiliary/translate/translate_sse.c