Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-10-24 22:42:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-10-24 22:44:57 +0300
commit5d5e0f1b0ecbe0aa3b047dfe7b1f3f4d2bf32cb0 (patch)
tree206a89981fc346accae94daf62ea2a0c8a4af8b4 /source/blender/draw/intern/draw_cache_impl_gpencil.cc
parente2d06eb68ab4bb474694ffd96b5d11dbb6741bb1 (diff)
GPencil: Fix crash when using circle or rectangle tool
This was caused by a wrongly sized vertex buffer for the stroke buffer.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_gpencil.cc')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_gpencil.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.cc b/source/blender/draw/intern/draw_cache_impl_gpencil.cc
index 9dbab8fef02..6c38b23f44f 100644
--- a/source/blender/draw/intern/draw_cache_impl_gpencil.cc
+++ b/source/blender/draw/intern/draw_cache_impl_gpencil.cc
@@ -629,9 +629,9 @@ static void gpencil_sbuffer_stroke_ensure(bGPdata *gpd, bool do_fill)
GPUVertFormat *format_color = gpencil_color_format();
GPUVertBuf *vbo = GPU_vertbuf_create_with_format_ex(format, vbo_flag);
GPUVertBuf *vbo_col = GPU_vertbuf_create_with_format_ex(format_color, vbo_flag);
- /* Add extra space at the end the buffer because of quad load and cyclic. */
- GPU_vertbuf_data_alloc(vbo, vert_len + 2);
- GPU_vertbuf_data_alloc(vbo_col, vert_len + 2);
+ /* Add extra space at the start and end the buffer because of quad load and cyclic. */
+ GPU_vertbuf_data_alloc(vbo, 1 + vert_len + 1 + 2);
+ GPU_vertbuf_data_alloc(vbo_col, 1 + vert_len + 1 + 2);
gpStrokeVert *verts = (gpStrokeVert *)GPU_vertbuf_get_data(vbo);
gpColorVert *cols = (gpColorVert *)GPU_vertbuf_get_data(vbo_col);