From c9c3635d370e750c17a9407574ac640ecd938c28 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 24 Jan 2017 01:08:30 +0100 Subject: [PATCH] Fix an issue where parked capture cards would be deleted, causing use-after-free. --- mixer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mixer.cpp b/mixer.cpp index 0d32612..878e430 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -281,6 +281,7 @@ void Mixer::set_output_card(int card_index) CaptureCard *card = &cards[card_index]; card->capture->stop_dequeue_thread(); card->parked_capture = card->capture; + card->capture = nullptr; FakeCapture *capture = new FakeCapture(global_flags.width, global_flags.height, FAKE_FPS, OUTPUT_FREQUENCY, card_index, global_flags.fake_cards_audio); configure_card(card_index, capture, /*is_fake_capture=*/true, card->output); card->queue_length_policy.reset(card_index); -- 2.39.2