diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-25 04:51:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-25 04:51:28 +0300 |
commit | 27cb6218a34a440a83c3b275e3cf69ea79245a1e (patch) | |
tree | 95652627317f61e5109777e030bbb7f81203ba3f /source/blender/blenloader | |
parent | 8e83dd0933cc02683ebbd9d8a9471b07f62dad55 (diff) |
fix [#25778] Memoryblock Data from SCR: end corrupt
+ other minor changes.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 6 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6fa70b0a9c2..e34a84139aa 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5279,7 +5279,11 @@ static void direct_link_screen(FileData *fd, bScreen *sc) for(cl= sconsole->history.first; cl; cl= cl_next) { cl_next= cl->next; cl->line= newdataadr(fd, cl->line); - if (cl->line == NULL) { + if (cl->line) { + /* the allocted length is not written, so reset here */ + cl->len_alloc= cl->len + 1; + } + else { BLI_remlink(&sconsole->history, cl); MEM_freeN(cl); } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 263d799aa69..c4623169aee 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2139,6 +2139,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase) ConsoleLine *cl; for (cl=con->history.first; cl; cl=cl->next) { + /* 'len_alloc' is invalid on write, set from 'len' on read */ writestruct(wd, DATA, "ConsoleLine", 1, cl); writedata(wd, DATA, cl->len+1, cl->line); } |