Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
virglrenderer
0001-737c3350-renderer-fix-memory-leak-in-verte...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-737c3350-renderer-fix-memory-leak-in-vertex-elements-state-cr.patch of Package virglrenderer
From 737c3350850ca4dbc5633b3bdb4118176ce59920 Mon Sep 17 00:00:00 2001 From: Dave Airlie <airlied@redhat.com> Date: Tue, 28 Feb 2017 14:52:09 +1000 Subject: [PATCH] renderer: fix memory leak in vertex elements state create Reported-by: Li Qiang Free the vertex array in error path. This was introduced by this commit: renderer: fix heap overflow in vertex elements state create. I rewrote the code to not require the allocation in the first place if we have an error, seems nicer. Signed-off-by: Dave Airlie <airlied@redhat.com> --- src/vrend_renderer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) Index: virglrenderer-0.6.0/src/vrend_renderer.c =================================================================== --- virglrenderer-0.6.0.orig/src/vrend_renderer.c +++ virglrenderer-0.6.0/src/vrend_renderer.c @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(s unsigned num_elements, const struct pipe_vertex_element *elements) { - struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_array); + struct vrend_vertex_element_array *v; const struct util_format_description *desc; GLenum type; int i; uint32_t ret_handle; - if (!v) - return ENOMEM; - if (num_elements > PIPE_MAX_ATTRIBS) return EINVAL; + v = CALLOC_STRUCT(vrend_vertex_element_array); + if (!v) + return ENOMEM; + v->count = num_elements; for (i = 0; i < num_elements; i++) { memcpy(&v->elements[i].base, &elements[i], sizeof(struct pipe_vertex_element));
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor