From 901b77d29e87b056beb70ccfca53f046115b80b4 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 19 Jan 2016 17:56:14 +0100 Subject: renderer: validate desc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau --- src/vrend_renderer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 78792d7..80641c2 100644 --- a/src/vrend_renderer.c +++ b/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) { -- cgit v1.2.3