diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2015-05-09 07:04:29 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2015-05-09 07:20:40 +0300 |
commit | 8c1b805f87209ae6282d77b213ed2527f2d7c207 (patch) | |
tree | 7e9451a76c622219dbcc676d761603b89393f319 /source | |
parent | eb811538960147e68fd6c2c530ed3ca67fa875e6 (diff) |
Freestyle: Partial fix for a crash with Save Buffers option enabled.
Prevents null pointer references in the case of the Save Buffers option
enabled. This is a regression likely due to rBd5f1b9c22233.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index 291ed98f905..64c6bd33924 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -493,12 +493,18 @@ void FRS_composite_result(Render *re, SceneRenderLayer *srl, Render *freestyle_r rl = render_get_active_layer( freestyle_render, freestyle_render->result ); if (!rl) { if (G.debug & G_DEBUG_FREESTYLE) { - cout << "No Freestyle result image to composite" << endl; + cout << "No source render layer to composite" << endl; } return; } - src = RE_RenderLayerGetPass(rl, SCE_PASS_COMBINED, re->viewname); + src = RE_RenderLayerGetPass(rl, SCE_PASS_COMBINED, freestyle_render->viewname); + if (!src) { + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "No source result image to composite" << endl; + } + return; + } #if 0 if (G.debug & G_DEBUG_FREESTYLE) { cout << "src: " << rl->rectx << " x " << rl->recty << endl; @@ -506,13 +512,19 @@ void FRS_composite_result(Render *re, SceneRenderLayer *srl, Render *freestyle_r #endif rl = RE_GetRenderLayer(re->result, srl->name); - if (!rl || src == NULL) { + if (!rl) { if (G.debug & G_DEBUG_FREESTYLE) { - cout << "No layer to composite to" << endl; + cout << "No destination render layer to composite to" << endl; } return; } dest = RE_RenderLayerGetPass(rl, SCE_PASS_COMBINED, re->viewname); + if (!dest) { + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "No destination result image to composite to" << endl; + } + return; + } #if 0 if (G.debug & G_DEBUG_FREESTYLE) { cout << "dest: " << rl->rectx << " x " << rl->recty << endl; |