fix: teardown UAF in Track block cache and headless test/render environment

- Track: new InputDisconnectedEvent trims blocks_/block_array_indexes_
  when a block edge is removed outside the Track's own operations
  (block deletion, undo commands detaching a whole track). Previously
  blocks_ kept dangling pointers and Project teardown crashed in
  track_length() (ASan heap-use-after-free in oakengine_timeline_edit /
  oakengine_sync). The persistent array map is intentionally not
  rewritten so undo of remove_track can re-attach the clips; replace_block
  guards the handler with ignore_block_disconnect_
- filefunctions: honor OAK_CONFIG_DIR to redirect the configuration
  root; QStandardPaths ignores XDG_* on macOS, so the engine tests read
  the real user config (a stale 0.1.x file) and failed frame-rate
  assertions. All engine tests now set OAK_CONFIG_DIR to their tmpdir
- init test: chdir to the fixture directory before loading
  project_with_footage.ove so the engine's moved-project footage
  relocation does not rewrite the stored relative filename
- renderworkerpool: do not let the render worker inherit
  QT_QPA_PLATFORM=offscreen from a headless host process; the worker
  needs a real platform GL context and exited immediately otherwise,
  failing oak_cli_transcode
This commit is contained in:
2026-08-01 20:35:13 +08:00
parent 8399d04b44
commit 30853cbcfd
18 changed files with 84 additions and 0 deletions
+9
View File
@@ -55,6 +55,15 @@ QString FileFunctions::get_unique_file_identifier(const QString &filename)
QString FileFunctions::get_configuration_location()
{
// Tests and tooling can redirect the configuration (and, since most
// locations derive from it, the cache/data) root. XDG_* vars only work
// on Linux; QStandardPaths ignores them on macOS and Windows.
const QByteArray override_dir = qgetenv("OAK_CONFIG_DIR");
if (!override_dir.isEmpty()) {
QDir(override_dir).mkpath(".");
return QString::fromUtf8(override_dir);
}
if (is_portable()) {
return get_application_path();
} else {