summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_context.h2
-rw-r--r--src/gallium/drivers/svga/svga_pipe_vertex.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index 4d9f00991a7..791d30edc0e 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -171,7 +171,7 @@ struct svga_sampler_state {
struct svga_velems_state {
unsigned count;
- struct pipe_vertex_element velem[];
+ struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
};
/* Use to calculate differences between state emitted to hardware and
diff --git a/src/gallium/drivers/svga/svga_pipe_vertex.c b/src/gallium/drivers/svga/svga_pipe_vertex.c
index 979deb12afb..d4a1280e74c 100644
--- a/src/gallium/drivers/svga/svga_pipe_vertex.c
+++ b/src/gallium/drivers/svga/svga_pipe_vertex.c
@@ -73,7 +73,7 @@ svga_create_vertex_elements_state(struct pipe_context *pipe,
{
struct svga_velems_state *velems;
assert(count <= PIPE_MAX_ATTRIBS);
- velems = (struct svga_velems_state *) MALLOC(sizeof(struct svga_velems_state) + count * sizeof(*attribs));
+ velems = (struct svga_velems_state *) MALLOC(sizeof(struct svga_velems_state));
if (velems) {
velems->count = count;
memcpy(velems->velem, attribs, sizeof(*attribs) * count);