2.5: fix text editor issue with scrolling and an invalid memory read.
This commit is contained in:
@@ -119,8 +119,8 @@ static void flatten_string_append(FlattenString *fs, char c, int accum)
|
||||
if(olen) fs->len*= 2;
|
||||
else fs->len= 256;
|
||||
|
||||
nbuf= MEM_mallocN(sizeof(*fs->buf)*fs->len, "fs->buf");
|
||||
naccum= MEM_mallocN(sizeof(*fs->accum)*fs->len, "fs->accum");
|
||||
nbuf= MEM_callocN(sizeof(*fs->buf)*fs->len, "fs->buf");
|
||||
naccum= MEM_callocN(sizeof(*fs->accum)*fs->len, "fs->accum");
|
||||
|
||||
if(olen) {
|
||||
memcpy(nbuf, fs->buf, olen);
|
||||
|
||||
@@ -1709,7 +1709,7 @@ static int scroll_exec(bContext *C, wmOperator *op)
|
||||
|
||||
screen_skip(st, lines*U.wheellinescroll);
|
||||
|
||||
WM_event_add_notifier(C, NC_TEXT|NA_EDITED, st->text);
|
||||
ED_area_tag_redraw(CTX_wm_area(C));
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user