From: Steinar H. Gunderson Date: Thu, 28 Feb 2019 21:30:46 +0000 (+0100) Subject: Fix a segfault that could happen with FFmpeg inputs and slow startup. X-Git-Tag: 1.8.3~25 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=39889eeed810016fd7d277d8bbfcc58e6f305c82 Fix a segfault that could happen with FFmpeg inputs and slow startup. --- diff --git a/nageru/mixer.cpp b/nageru/mixer.cpp index 367094c..d1b52ef 100644 --- a/nageru/mixer.cpp +++ b/nageru/mixer.cpp @@ -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(card->capture.get()); userdata->has_last_subtitle = ffmpeg_capture->get_has_last_subtitle(); userdata->last_subtitle = ffmpeg_capture->get_last_subtitle();