forked from bartvdbraak/blender
- off by 1 error with console command line memory re-allocation.
- documenting vgroups crashed.
This commit is contained in:
parent
434af76286
commit
aec894939f
@ -1230,13 +1230,13 @@ static int set_active_group_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *ptr, int *free)
|
static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *ptr, int *free)
|
||||||
{
|
{
|
||||||
Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
|
Object *ob;
|
||||||
EnumPropertyItem tmp = {0, "", 0, "", ""};
|
EnumPropertyItem tmp = {0, "", 0, "", ""};
|
||||||
EnumPropertyItem *item= NULL;
|
EnumPropertyItem *item= NULL;
|
||||||
bDeformGroup *def;
|
bDeformGroup *def;
|
||||||
int a, totitem= 0;
|
int a, totitem= 0;
|
||||||
|
|
||||||
if(!C) /* needed for docs */
|
if(!C || !(ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data)) /* needed for docs */
|
||||||
return vgroup_items;
|
return vgroup_items;
|
||||||
|
|
||||||
for(a=0, def=ob->defbase.first; def; def=def->next, a++) {
|
for(a=0, def=ob->defbase.first; def; def=def->next, a++) {
|
||||||
|
@ -190,7 +190,7 @@ ConsoleLine *console_history_verify(const bContext *C)
|
|||||||
static void console_line_verify_length(ConsoleLine *ci, int len)
|
static void console_line_verify_length(ConsoleLine *ci, int len)
|
||||||
{
|
{
|
||||||
/* resize the buffer if needed */
|
/* resize the buffer if needed */
|
||||||
if(len > ci->len_alloc) {
|
if(len >= ci->len_alloc) {
|
||||||
int new_len= len * 2; /* new length */
|
int new_len= len * 2; /* new length */
|
||||||
char *new_line= MEM_callocN(new_len, "console line");
|
char *new_line= MEM_callocN(new_len, "console line");
|
||||||
memcpy(new_line, ci->line, ci->len);
|
memcpy(new_line, ci->line, ci->len);
|
||||||
|
Loading…
Reference in New Issue
Block a user