From c545db61d7cbe91ea64814a338bf994f3711333d Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 14 Dec 2024 16:48:18 +0100 Subject: [PATCH] Fix crash on re-setup of video stream --- client/scenes/stream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index a6a42427..3898dd6a 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -303,7 +303,8 @@ void scenes::stream::push_blit_handle(shard_accumulator * decoder, std::shared_p auto stream = handle->feedback.stream_index; if (stream < decoders.size()) { - assert(decoder == decoders[stream].decoder.get()); + if (decoder != decoders[stream].decoder.get()) + return; handle->feedback.received_from_decoder = application::now(); std::swap(handle, decoders[stream].latest_frames[handle->feedback.frame_index % decoders[stream].latest_frames.size()]); } @@ -663,7 +664,7 @@ void scenes::stream::render(const XrFrameState & frame_state) // Blit images from the decoders for (auto [i, blit_handle]: std::views::zip(decoders, current_blit_handles)) { - if (not blit_handle) + if (not blit_handle or not *i.blit_pipeline) continue; blit_handle->feedback.blitted = application::now();