Solved crash caused by referencing NULL ->camera pointer in preview for
authorTon Roosendaal <ton@blender.org>
Wed, 14 Apr 2004 12:52:35 +0000 (12:52 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 14 Apr 2004 12:52:35 +0000 (12:52 +0000)
World shading buttons.
Thanks Goofster for reporting it!

source/blender/src/previewrender.c

index 9621c3f2faa87b67d467a1812ede9e1cfa20e6e8..4bfe5265f27c128f77dc6ea574e93d04f60b8d6e 100644 (file)
@@ -1081,12 +1081,12 @@ void BIF_previewrender(SpaceButs *sbuts)
                lens= 35.0;
                if(G.scene->camera) {
                        lens= ( (Camera *)G.scene->camera->data)->lens;
-               }
-               /* needed for init_render_world */
-               MTC_Mat4CpyMat4(R.viewinv, G.scene->camera->obmat);
-               MTC_Mat4Ortho(R.viewinv);
-               MTC_Mat4Invert(R.viewmat, R.viewinv);
 
+                       /* needed for init_render_world */
+                       MTC_Mat4CpyMat4(R.viewinv, G.scene->camera->obmat);
+                       MTC_Mat4Ortho(R.viewinv);
+                       MTC_Mat4Invert(R.viewmat, R.viewinv);
+               }
                init_render_world();
                init_render_textures(); /* dont do it twice!! (brightness) */
        }