Text3d: assert for <0 len text

also add operator to test blacklist
This commit is contained in:
Campbell Barton 2014-09-10 23:01:22 +10:00
parent 3ad9027648
commit 7d9760d962
3 changed files with 5 additions and 0 deletions

View File

@ -488,6 +488,7 @@ int BKE_vfont_select_get(Object *ob, int *r_start, int *r_end)
if ((ob->type != OB_FONT) || (ef == NULL)) return 0;
BLI_assert(ef->len >= 0);
BLI_assert(ef->selstart >= 0 && ef->selstart <= ef->len + 1);
BLI_assert(ef->selend >= 0 && ef->selend <= ef->len);
BLI_assert(ef->pos >= 0 && ef->pos <= ef->len);

View File

@ -248,6 +248,8 @@ static void text_update_edited(bContext *C, Object *obedit, int mode)
Curve *cu = obedit->data;
EditFont *ef = cu->editfont;
BLI_assert(ef->len >= 0);
/* run update first since it can move the cursor */
if (mode == FO_EDIT) {
/* re-tesselllate */
@ -1583,6 +1585,7 @@ void make_editText(Object *obedit)
len_wchar = BLI_strncpy_wchar_from_utf8(ef->textbuf, cu->str, MAXTEXT + 4);
BLI_assert(len_wchar == cu->len_wchar);
ef->len = len_wchar;
BLI_assert(ef->len >= 0);
memcpy(ef->textbufinfo, cu->strinfo, ef->len * sizeof(CharInfo));

View File

@ -66,6 +66,7 @@ op_blacklist = (
"wm.doc_edit",
"wm.doc_view_manual",
"wm.path_open",
"wm.copy_prev_settings",
"wm.theme_install",
"wm.context_*",
"wm.properties_add",