From dab6f8f5593876ac1c1f9d445c35401ed840b574 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 5 Mar 2013 11:19:21 +0000 Subject: Bug fix #34534 Fix for 2.66a The new Copy/Paste objects feature could hang in eternal loop. Only happens for objects that refer to another scene via linkage. This fix then crashed Blender, needed to add a NULL check for screens. --- source/blender/blenloader/intern/writefile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index d222691e1f4..01cf0a4a342 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -798,14 +798,15 @@ typedef struct RenderInfo { static void write_renderinfo(WriteData *wd, Main *mainvar) { bScreen *curscreen; - Scene *sce; + Scene *sce, *curscene = NULL; RenderInfo data; /* XXX in future, handle multiple windows with multiple screens? */ current_screen_compat(mainvar, &curscreen); - + if (curscreen) curscene = curscreen->scene; + for (sce= mainvar->scene.first; sce; sce= sce->id.next) { - if (sce->id.lib == NULL && (sce == curscreen->scene || (sce->r.scemode & R_BG_RENDER))) { + if (sce->id.lib == NULL && (sce == curscene || (sce->r.scemode & R_BG_RENDER))) { data.sfra = sce->r.sfra; data.efra = sce->r.efra; memset(data.scene_name, 0, sizeof(data.scene_name)); -- cgit v1.2.3