]> git.sesse.net Git - nageru/blobdiff - nageru/mixer.cpp
Fix a segfault that could happen with FFmpeg inputs and slow startup.
[nageru] / nageru / mixer.cpp
index 367094cfeb08c35af2a9dfb9fdd1c5a0ae2d4892..d1b52ef2dc54b4a9db8ad84e755bbadc4ac76411 100644 (file)
@@ -795,7 +795,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
        card->last_timecode = timecode;
 
        PBOFrameAllocator::Userdata *userdata = (PBOFrameAllocator::Userdata *)video_frame.userdata;
-       if (card->type == CardType::FFMPEG_INPUT) {
+       if (card->type == CardType::FFMPEG_INPUT && userdata != nullptr) {
                FFmpegCapture *ffmpeg_capture = static_cast<FFmpegCapture *>(card->capture.get());
                userdata->has_last_subtitle = ffmpeg_capture->get_has_last_subtitle();
                userdata->last_subtitle = ffmpeg_capture->get_last_subtitle();