From 8b4da9a191b9a35c743209d38c99c000f8490501 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 18 Feb 2022 10:14:34 +0100 Subject: Fix strict compilation warnings --- source/blender/draw/intern/draw_cache_impl_subdivision.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index 60c07db90b7..e8ff9a508a2 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -1818,9 +1818,9 @@ static bool draw_subdiv_create_requested_buffers(const Scene *scene, const float obmat[4][4], const bool do_final, const bool do_uvedit, - const bool use_subsurf_fdots, + const bool /*use_subsurf_fdots*/, const ToolSettings *ts, - const bool use_hide, + const bool /*use_hide*/, OpenSubdiv_EvaluatorCache *evaluator_cache) { SubsurfModifierData *smd = BKE_object_get_last_subsurf_modifier(ob); -- cgit v1.2.3 From 02f4d63dcc7b74fbacfb4e5bcdd01766563573f5 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 18 Feb 2022 12:11:59 +0100 Subject: Fix broken shapekeys: check for 'NULL' `from` pointer too. Add check for `NULL` `from` pointer to `BLO_main_validate_shapekeys`, and delete these shapekeys, as they are fully invalid and impossible to recover. Found in a studio production file (`animation test/snow_parkour/shots/0040/0040.lighting.blend`, svn rev `1111`). Would be nice to know how this was generated too... --- source/blender/blenloader/intern/blend_validate.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source') diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c index 333f6e341c6..c8dd27f0c9c 100644 --- a/source/blender/blenloader/intern/blend_validate.c +++ b/source/blender/blenloader/intern/blend_validate.c @@ -195,5 +195,20 @@ bool BLO_main_validate_shapekeys(Main *bmain, ReportList *reports) BKE_main_unlock(bmain); + /* NOTE: #BKE_id_delete also locks `bmain`, so we need to do this loop outside of the lock here. + */ + LISTBASE_FOREACH_MUTABLE (Key *, shapekey, &bmain->shapekeys) { + if (shapekey->from != NULL) { + continue; + } + + BKE_reportf(reports, + RPT_ERROR, + "Shapekey %s has an invalid 'from' pointer (%p), it will be deleted", + shapekey->id.name, + shapekey->from); + BKE_id_delete(bmain, shapekey); + } + return is_valid; } -- cgit v1.2.3