st/glsl_to_tgsi: fix potential crash when allocating temporaries
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 28 Apr 2016 19:09:12 +0000 (21:09 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 30 Apr 2016 15:41:32 +0000 (17:41 +0200)
commit8f2238ccbae399a20fce24c5941accced7cee8d2
tree68622d85a7be7c857f759a4a739a0d674f1bac1d
parent750c38fad1f19e2403b4960674006c5f932075ad
st/glsl_to_tgsi: fix potential crash when allocating temporaries

When index - t->temps_size is greater than 4096, allocating space for
temporaries on demand will miserably crash. This can happen when a game
uses a lot of temporaries like the recent released Tomb raider.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp