diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-09 00:19:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-09 00:19:15 +0300 |
commit | 051c6e999f2c9c4f99cdf716f578d8e09336f8b5 (patch) | |
tree | d990cfe92b25db54cd0428d11966809800b56589 | |
parent | 616af4fa52b4bdc3cbee3d6d1f17b5d1fb54a0b6 (diff) |
partial fix for [#21036] crash with glsl shading
copying UVs was doing a buffer overrun.
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index ac79322dd20..401985ce285 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -974,8 +974,8 @@ void GPU_buffer_copy_uv( DerivedMesh *dm, float *varray, int *index, int *redir, GPUBuffer *GPU_buffer_uv( DerivedMesh *dm ) { DEBUG_VBO("GPU_buffer_uv\n"); - if( DM_get_face_data_layer(dm, CD_MTFACE) != 0 ) - return GPU_buffer_setup( dm, dm->drawObject, sizeof(float)*2*dm->drawObject->nelements, GL_ARRAY_BUFFER_ARB, 0, GPU_buffer_copy_uv); + if( DM_get_face_data_layer(dm, CD_MTFACE) != 0 ) /* was sizeof(float)*2 but caused buffer overrun */ + return GPU_buffer_setup( dm, dm->drawObject, sizeof(float)*3*dm->drawObject->nelements, GL_ARRAY_BUFFER_ARB, 0, GPU_buffer_copy_uv); else return 0; } |