decklink: Fix crash (null pointer dereference)

This is my fault; I made an idiotic assumption about the data and it
ended up causing the plugin to crash.  This is definitely one of my more
embarrassing moments.
This commit is contained in:
jp9000 2015-07-25 09:51:30 -07:00
parent ffb3ca4595
commit 595de46e9d

View File

@ -140,12 +140,14 @@ HRESULT STDMETHODCALLTYPE DeckLinkDeviceInstance::VideoInputFrameArrived(
BMDTimeValue videoDur = 0;
BMDTimeValue audioTS = 0;
videoFrame->GetStreamTime(&videoTS, &videoDur, TIME_BASE);
audioPacket->GetPacketTime(&audioTS, TIME_BASE);
if (videoFrame)
videoFrame->GetStreamTime(&videoTS, &videoDur, TIME_BASE);
if (audioPacket)
audioPacket->GetPacketTime(&audioTS, TIME_BASE);
if (videoTS >= 0)
if (videoFrame && videoTS >= 0)
HandleVideoFrame(videoFrame, (uint64_t)videoTS);
if (audioTS >= 0)
if (audioPacket && audioTS >= 0)
HandleAudioPacket(audioPacket, (uint64_t)audioTS);
return S_OK;