renderer: validate desc

Fix found thanks to american fuzzy lop.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 043905990f
commit 901b77d29e
  1. 4
      src/vrend_renderer.c

@ -1642,6 +1642,10 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
memcpy(&v->elements[i].base, &elements[i], sizeof(struct pipe_vertex_element));
desc = util_format_description(elements[i].src_format);
if (!desc) {
FREE(v);
return EINVAL;
}
type = GL_FALSE;
if (desc->channel[0].type == UTIL_FORMAT_TYPE_FLOAT) {

Loading…
Cancel
Save