Fix T75405: Crash when increasing text object bevel depth

One fewer coordinate needs to be calculated when extrusion is zero to
avoid corrupting the end of the memory chunk.

Differential Revision: https://developer.blender.org/D7368
This commit is contained in:
Hans Goudey 2020-04-09 15:29:49 -05:00
parent 054950def9
commit d7273f087d
Notes: blender-bot 2023-02-14 11:28:39 +01:00
Referenced by issue #75592, curves displayed incorrectly
Referenced by issue #75405, Crash when increasing text object bevel depth
1 changed files with 2 additions and 1 deletions

View File

@ -1877,7 +1877,8 @@ void BKE_curve_bevel_make(Object *ob, ListBase *disp)
}
/* Don't duplicate the last back vertex. */
angle = (cu->ext1 == 0.0f && (cu->flag & CU_BACK)) ? dangle : 0;
for (a = 0; a < cu->bevresol + 2; a++) {
int front_len = (cu->ext1 == 0.0f) ? cu->bevresol + 1 : cu->bevresol + 2;
for (a = 0; a < front_len; a++) {
fp[0] = 0.0;
fp[1] = (float)(cosf(angle) * (cu->ext2));
fp[2] = (float)(sinf(angle) * (cu->ext2)) + cu->ext1;