diff options
author | Mathias Fröhlich <[email protected]> | 2018-03-22 05:34:09 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-03-23 19:59:02 +0100 |
commit | 4a8ef1f5d4c5fc96194be65045e6a3d4f5b9f913 (patch) | |
tree | 0852c2ea2e19b15fcb23c4b299e8ac9d45b38a85 /src/mesa/vbo/vbo_exec_draw.c | |
parent | 1a131aaf4b03502980ea109c44531da8f965ecaa (diff) |
vbo: Make sure the internal VAO's stay within limits.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 026b7be129e..31d77002257 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -200,8 +200,10 @@ vbo_exec_bind_arrays(struct gl_context *ctx) assert((~vao_enabled & vao->_Enabled) == 0); /* Bind the buffer object */ + const GLuint stride = exec->vtx.vertex_size*sizeof(GLfloat); + assert(stride <= ctx->Const.MaxVertexAttribStride); _mesa_bind_vertex_buffer(ctx, vao, 0, exec->vtx.bufferobj, buffer_offset, - exec->vtx.vertex_size*sizeof(GLfloat), false); + stride, false); /* Retrieve the mapping from VBO_ATTRIB to VERT_ATTRIB space * Note that the position/generic0 aliasing is done in the VAO. @@ -217,6 +219,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx) const GLenum16 type = exec->vtx.attrtype[vbo_attr]; const GLuint offset = (GLuint)((GLbyte *)exec->vtx.attrptr[vbo_attr] - (GLbyte *)exec->vtx.vertex); + assert(offset <= ctx->Const.MaxVertexAttribRelativeOffset); /* Set and enable */ _vbo_set_attrib_format(ctx, vao, vao_attr, buffer_offset, |