Prechádzať zdrojové kódy

Decklink: Fix crash when no matching device

OBS crashes when decklink output is auto started and the device is
removed or changed to different model while OBS is not running.

Fixes https://github.com/obsproject/obs-studio/issues/2494
Afriza N. Arief 5 rokov pred
rodič
commit
f7332b467a
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 3 0
      plugins/decklink/decklink-output.cpp

+ 3 - 0
plugins/decklink/decklink-output.cpp

@@ -60,6 +60,9 @@ static bool decklink_output_start(void *data)
 
 	device.Set(deviceEnum->FindByHash(decklink->deviceHash));
 
+	if (!device)
+		return false;
+
 	DeckLinkDeviceMode *mode = device->FindOutputMode(decklink->modeID);
 
 	decklink->SetSize(mode->GetWidth(), mode->GetHeight());