From 57ca6830eb02c8b287bd2e5c37a35bbc7dbb773b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 4 Feb 2015 14:26:08 +1000 Subject: [PATCH] renderer: only write get_cursor_contexts if required --- src/vrend_renderer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 1093bb3..f0971ee 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -5302,8 +5302,10 @@ void *vrend_renderer_get_cursor_contents(uint32_t res_handle, uint32_t *width, u if (res->target != GL_TEXTURE_2D) return NULL; - *width = res->base.width0; - *height = res->base.height0; + if (width) + *width = res->base.width0; + if (height) + *height = res->base.height0; format = tex_conv_table[res->base.format].glformat; type = tex_conv_table[res->base.format].gltype; blsize = util_format_get_blocksize(res->base.format);