aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2020-03-24 16:54:32 +0200
committerMarge Bot <[email protected]>2020-03-24 22:54:12 +0000
commitba56684a14101820a8f8d6ebf8682e12a383288d (patch)
tree982f006634d71b16d8b25362eec3b5bd1a5c1199 /src/mesa
parent8a3e2cd9b26beb4d57ea417c4528e22c00c92126 (diff)
i965/iris: fix crash when calling GetPerfQueryDataINTEL
On a query that was never begun. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/performance_query.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/performance_query.c b/src/mesa/main/performance_query.c
index 1eaf0bb1a76..c5825a7da3a 100644
--- a/src/mesa/main/performance_query.c
+++ b/src/mesa/main/performance_query.c
@@ -617,6 +617,15 @@ _mesa_GetPerfQueryDataINTEL(GLuint queryHandle, GLuint flags,
*/
*bytesWritten = 0;
+ /* Not explicitly covered in the spec but a query that was never started
+ * cannot return any data.
+ */
+ if (!obj->Used) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetPerfQueryDataINTEL(query never began)");
+ return;
+ }
+
/* Not explicitly covered in the spec but to be consistent with
* EndPerfQuery which validates that an application only ends an
* active query we also validate that an application doesn't try