Fix T44329: Blender Crash when rendering in 3DView.
This commit fixes two different issues actually: * When view name is unknown/irrelevant, you should pass a NULL str pointer to `RE_RenderLayerGetPass()`, not an empty string! * `render_result_rescale()` would unconditionnaly free re->result (at the end), even if it did not replaced it at all, leading to freed memory access later. This is only a partial fix though, "CacheBuffer" (i.e. saving tiles in EXR files) shall not be used in 3DView rendering, and yet it is here...
This commit is contained in:
parent
253d15ea16
commit
1e71270f77
Notes:
blender-bot
2023-02-14 09:15:36 +01:00
Referenced by issue #44329, Blender Crash
|
@ -202,7 +202,7 @@ float *RE_RenderLayerGetPass(volatile RenderLayer *rl, int passtype, const char
|
|||
|
||||
if (viewname == NULL)
|
||||
break;
|
||||
else if (strcmp(rpass->view, viewname) == 0)
|
||||
else if (STREQ(rpass->view, viewname))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ static void render_result_rescale(Render *re)
|
|||
if (src_rectf == NULL) {
|
||||
RenderLayer *rl = render_get_active_layer(re, re->result);
|
||||
if (rl != NULL) {
|
||||
src_rectf = RE_RenderLayerGetPass(rl, SCE_PASS_COMBINED, "");
|
||||
src_rectf = RE_RenderLayerGetPass(rl, SCE_PASS_COMBINED, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -795,7 +795,7 @@ static void render_result_rescale(Render *re)
|
|||
RenderLayer *rl;
|
||||
rl = render_get_active_layer(re, re->result);
|
||||
if (rl != NULL) {
|
||||
dst_rectf = RE_RenderLayerGetPass(rl, SCE_PASS_COMBINED, "");
|
||||
dst_rectf = RE_RenderLayerGetPass(rl, SCE_PASS_COMBINED, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -812,9 +812,8 @@ static void render_result_rescale(Render *re)
|
|||
}
|
||||
}
|
||||
}
|
||||
render_result_free(result);
|
||||
}
|
||||
|
||||
render_result_free(result);
|
||||
}
|
||||
|
||||
void RE_ChangeResolution(Render *re, int winx, int winy, rcti *disprect)
|
||||
|
|
Loading…
Reference in New Issue