Crash fix! Found one unsafe malloc in allocating the Z render pass...

Brought back threaded compositing, this was blamed incorrectly.
This commit is contained in:
2006-02-03 09:25:46 +00:00
parent 4b05af9ca7
commit 7a7c33ea27
2 changed files with 6 additions and 6 deletions

View File

@@ -1711,7 +1711,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
if(ntree==NULL) return; if(ntree==NULL) return;
if(rd->mode & R_THREADS) if(rd->mode & R_THREADS)
maxthreads= 1; maxthreads= 2;
else else
maxthreads= 1; maxthreads= 1;

View File

@@ -177,11 +177,11 @@ static void free_render_result(RenderResult *res)
static void render_layer_add_pass(RenderLayer *rl, int rectsize, int passtype, char *mallocstr) static void render_layer_add_pass(RenderLayer *rl, int rectsize, int passtype, char *mallocstr)
{ {
RenderPass *rpass= MEM_mallocN(sizeof(RenderPass), mallocstr); RenderPass *rpass= RE_mallocN(sizeof(RenderPass), mallocstr);
BLI_addtail(&rl->passes, rpass); BLI_addtail(&rl->passes, rpass);
rpass->passtype= passtype; rpass->passtype= passtype;
rpass->rect= MEM_callocN(sizeof(float)*rectsize, mallocstr); rpass->rect= RE_callocN(sizeof(float)*rectsize, mallocstr);
} }
float *RE_RenderLayerGetPass(RenderLayer *rl, int passtype) float *RE_RenderLayerGetPass(RenderLayer *rl, int passtype)
@@ -851,7 +851,7 @@ static void do_render_final(Render *re, Scene *scene)
re->i.starttime= PIL_check_seconds_timer(); re->i.starttime= PIL_check_seconds_timer();
if(re->r.scemode & R_DOSEQ) { if(re->r.scemode & R_DOSEQ) {
re->result->rect32= MEM_callocN(sizeof(int)*re->rectx*re->recty, "rectot"); re->result->rect32= RE_callocN(sizeof(int)*re->rectx*re->recty, "rectot");
if(!re->test_break()) if(!re->test_break())
do_render_seq(re->result); do_render_seq(re->result);
} }
@@ -1038,12 +1038,12 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra)
/* note; the way it gets 32 bits rects is weak... */ /* note; the way it gets 32 bits rects is weak... */
int dofree=0; int dofree=0;
if(rres.rect32==NULL) { if(rres.rect32==NULL) {
rres.rect32= MEM_mallocN(sizeof(int)*rres.rectx*rres.recty, "temp 32 bits rect"); rres.rect32= RE_mallocN(sizeof(int)*rres.rectx*rres.recty, "temp 32 bits rect");
dofree= 1; dofree= 1;
} }
RE_ResultGet32(re, rres.rect32); RE_ResultGet32(re, rres.rect32);
mh->append_movie(scene->r.cfra, rres.rect32, rres.rectx, rres.recty); mh->append_movie(scene->r.cfra, rres.rect32, rres.rectx, rres.recty);
if(dofree) MEM_freeN(rres.rect32); if(dofree) RE_freeN(rres.rect32);
printf("Append frame %d", scene->r.cfra); printf("Append frame %d", scene->r.cfra);
} }
else { else {