]> git.sesse.net Git - nageru/commitdiff
Fix an issue where parked capture cards would be deleted, causing use-after-free.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 24 Jan 2017 00:08:30 +0000 (01:08 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 24 Jan 2017 00:08:30 +0000 (01:08 +0100)
mixer.cpp

index 0d32612776f67422a7dffe53d33382f40b407787..878e430106ef2ff8e5542786736fd3d2bac151bb 100644 (file)
--- 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);