libobs: Fix possible use-after-free of obs_scene_t

When creating a group, a newly allocated group `sub_scene` is released
just after calling `obs_scene_add_internal`.
If another thread released the scene-item, which is the sub_scene,
use-after-free might happen.
This commit is contained in:
Norihiro Kamae
2023-03-18 14:05:04 +09:00
committed by Jim
parent 0959a22de3
commit 434bdc1768
2 changed files with 5 additions and 4 deletions

View File

@@ -354,6 +354,6 @@ void OBSBasicTransform::OnSceneChanged(QListWidgetItem *current,
if (!current)
return;
obs_scene_t *scene = GetOBSRef<OBSScene>(current);
OBSScene scene = GetOBSRef<OBSScene>(current);
this->SetScene(scene);
}