diff options
author | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-06-22 23:11:01 -0700 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-06-22 23:11:01 -0700 |
commit | a6cc91487446f8e1e72e4f67823a359c0b3a41d6 (patch) | |
tree | a676a1a8e905699f1cadd3a9c01a19d14379bee8 /src/gallium/drivers/r300/r300_query.c | |
parent | aa451d509df844e4652853f08e31bc1ee18c04ac (diff) |
glhd: Add query protection.
Not quite copied from r300g. This is slightly more API-compliant.
Diffstat (limited to 'src/gallium/drivers/r300/r300_query.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_query.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c index 10cb468dfc..10086ee925 100644 --- a/src/gallium/drivers/r300/r300_query.c +++ b/src/gallium/drivers/r300/r300_query.c @@ -37,7 +37,9 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe, struct r300_screen *r300screen = r300->screen; struct r300_query *q; - assert(query_type == PIPE_QUERY_OCCLUSION_COUNTER); + if (query_type != PIPE_QUERY_OCCLUSION_COUNTER) { + return NULL; + } q = CALLOC_STRUCT(r300_query); if (!q) |