summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-01-19 17:56:14 +0100
committerDave Airlie <airlied@redhat.com>2016-02-10 12:39:47 +1000
commit901b77d29e87b056beb70ccfca53f046115b80b4 (patch)
treed545a52e45c57ed256441b63774d4316f1363d04
parent043905990f611a150f02d6ef8e0da2353b5705dc (diff)
renderer: validate desc
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r--src/vrend_renderer.c4
1 files changed, 4 insertions, 0 deletions
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) {