Cleanup: remove assignment from a NULL struct
Quiet ASAN 'member access within null pointer' warning. While this doesn't crash, access to 'shading' without checking if the 'v3d' would have.
This commit is contained in:
parent
920b138f83
commit
eb87b1c8f6
|
@ -107,9 +107,9 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata,
|
||||||
EEVEE_EffectsInfo *effects = stl->effects;
|
EEVEE_EffectsInfo *effects = stl->effects;
|
||||||
EEVEE_PrivateData *g_data = stl->g_data;
|
EEVEE_PrivateData *g_data = stl->g_data;
|
||||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||||
View3D *v3d = draw_ctx->v3d;
|
/* The view will be NULL when rendering previews. */
|
||||||
View3DShading *shading = &v3d->shading;
|
const View3D *v3d = draw_ctx->v3d;
|
||||||
Scene *scene = draw_ctx->scene;
|
const Scene *scene = draw_ctx->scene;
|
||||||
|
|
||||||
const bool probe_render = pinfo != NULL;
|
const bool probe_render = pinfo != NULL;
|
||||||
|
|
||||||
|
@ -150,6 +150,7 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d)) {
|
if (LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d)) {
|
||||||
|
const View3DShading *shading = &v3d->shading;
|
||||||
StudioLight *sl = BKE_studiolight_find(shading->lookdev_light,
|
StudioLight *sl = BKE_studiolight_find(shading->lookdev_light,
|
||||||
STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE);
|
STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE);
|
||||||
if (sl && (sl->flag & STUDIOLIGHT_TYPE_WORLD)) {
|
if (sl && (sl->flag & STUDIOLIGHT_TYPE_WORLD)) {
|
||||||
|
|
Loading…
Reference in New Issue