From 84d86984885759f8f21d382cc8c699341be626a3 Mon Sep 17 00:00:00 2001 From: Miguel Pozo Date: Mon, 7 Nov 2022 15:30:15 +0100 Subject: Fix T101533: Wrong DoF when a non-camera object is the active camera Make sure non-camera data is not casted to a Camera pointer. Solution suggested by Damien Picard (@pioverfour). --- source/blender/draw/engines/eevee/eevee_depth_of_field.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/draw/engines/eevee/eevee_depth_of_field.c') diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 0d14a0c5f61..caa63b9c54c 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -189,7 +189,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), const DRWContextState *draw_ctx = DRW_context_state_get(); const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph); - Camera *cam = (camera != NULL) ? camera->data : NULL; + Camera *cam = (camera != NULL && camera->type == OB_CAMERA) ? camera->data : NULL; if (cam && (cam->dof.flag & CAM_DOF_ENABLED)) { RegionView3D *rv3d = draw_ctx->rv3d; -- cgit v1.2.3