renderer: Fix potential dereference of null pointer

glReadPixels, glReadnPixelsKHR and glReadnPixelsARB use *width and *height.
Thos could be null.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Elie Tournier 6 years ago committed by Jakob Bornecrantz
parent 94a07ad532
commit 3ed2781420
  1. 10
      src/vrend_renderer.c

@ -8482,10 +8482,12 @@ void *vrend_renderer_get_cursor_contents(uint32_t res_handle, uint32_t *width, u
if (res->target != GL_TEXTURE_2D)
return NULL;
if (width)
*width = res->base.width0;
if (height)
*height = res->base.height0;
if (!width || !height)
return NULL;
*width = res->base.width0;
*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);

Loading…
Cancel
Save