From 8abff20185211756e1a87f553c31a471b9c9744e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 8 Aug 2015 15:17:54 +0100 Subject: [PATCH] decklinkvideosrc: don't crash if we get NULL video frames in the callback For some reason we seem to sometimes get NULL video_frames in the ::VideoInputFrameArrived() callback, observed on Intensity Pro cards. https://bugzilla.gnome.org/show_bug.cgi?id=747633 --- sys/decklink/gstdecklink.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index 64637f1d9f..2516e1d549 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -535,6 +535,9 @@ public: BMDTimeValue capture_time, capture_duration; HRESULT res; + if (video_frame == NULL) + goto no_video_frame; + res = video_frame->GetHardwareReferenceTimestamp (GST_SECOND, &capture_time, &capture_duration); @@ -573,7 +576,9 @@ public: capture_duration); } - if (got_audio_packet && audiosrc) { +no_video_frame: + + if (audio_packet && got_audio_packet && audiosrc) { m_input->got_audio_packet (audiosrc, audio_packet, capture_time); }