Page MenuHome

Fix T88551: Crash accessing uninitialized tool settings
ClosedPublic

Authored by Richard Antalik (ISS) on May 25 2021, 2:34 PM.

Details

Summary

Tool settings for sequencer were not initialized, which caused crash
when adding strips.

There was fix for same issue in versioning rB0f81dafe6cec, but
subversion was not bumped, so files with uninitialized tool settings
may still exist.

Add SEQ_tool_settings_get() accessor function that will initialize
tool settings if they are missing. Change operator code to use
SEQ_tool_settings_fit_method_get() function instead of accessing
tool settings directly

Diff Detail

Repository
rB Blender

Event Timeline

Richard Antalik (ISS) requested review of this revision.May 25 2021, 2:34 PM
Richard Antalik (ISS) created this revision.
Campbell Barton (campbellbarton) added inline comments.
source/blender/sequencer/intern/sequencer.c
316

Prefer name SEQ_tool_settings_ensure for functions that create new data when it doesn't exist. Otherwise it's not obvious why using _get is any better than direct pointer access.

Other examples include WM_keymap_ensure, BKE_mesh_runtime_looptri_ensure, BKE_mesh_texspace_ensure.

This revision is now accepted and ready to land.May 25 2021, 2:42 PM