[Mesa-dev] [PATCH] Mesa: Fix performance query id check

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Mon Feb 27 14:47:03 UTC 2017


In queryid_valid() fix handling of zero index.

CC: Robert Bragg <robert at sixbynine.org>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/main/performance_query.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/performance_query.c b/src/mesa/main/performance_query.c
index aa10351..142d834 100644
--- a/src/mesa/main/performance_query.c
+++ b/src/mesa/main/performance_query.c
@@ -91,7 +91,7 @@ static inline bool
 queryid_valid(const struct gl_context *ctx, unsigned numQueries, GLuint queryid)
 {
    GLuint index = queryid_to_index(queryid);
-   return index >= 0 && index < numQueries;
+   return queryid != 0 && index < numQueries;
 }
 
 static inline GLuint
-- 
2.7.4



More information about the mesa-dev mailing list