Selection: avoid uninitialized memory read with occlusion queries

This commit is contained in:
2015-02-02 17:45:07 +01:00
parent 2c82e748c1
commit 23e3dbb726

View File

@@ -158,7 +158,7 @@ bool GPU_select_load_id(unsigned int id)
g_query_state.active_query++;
g_query_state.query_issued = true;
if (g_query_state.mode == GPU_SELECT_NEAREST_SECOND_PASS) {
if (g_query_state.mode == GPU_SELECT_NEAREST_SECOND_PASS && g_query_state.index < g_query_state.oldhits) {
if (g_query_state.buffer[g_query_state.index * 4 + 3] == id) {
g_query_state.index++;
return true;