]> git.sesse.net Git - nageru/commitdiff
Fix a crash on receiving dummy frames.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 29 Dec 2018 23:32:51 +0000 (00:32 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 29 Dec 2018 23:32:51 +0000 (00:32 +0100)
nageru/mixer.cpp

index 23ad51480e78be9cd4ab52b9d086305415e3b99e..7ef2a4c576d185fb72a9e0895cb9cd3142248a8b 100644 (file)
@@ -798,7 +798,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
 
        size_t cbcr_width, cbcr_height, cbcr_offset, y_offset;
        size_t expected_length = video_format.stride * (video_format.height + video_format.extra_lines_top + video_format.extra_lines_bottom);
-       if (userdata->pixel_format == PixelFormat_8BitYCbCrPlanar) {
+       if (userdata != nullptr && userdata->pixel_format == PixelFormat_8BitYCbCrPlanar) {
                // The calculation above is wrong for planar Y'CbCr, so just override it.
                assert(card->type == CardType::FFMPEG_INPUT);
                assert(video_offset == 0);