Просмотр исходного кода

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 лет назад
Родитель
Сommit
f7332b467a
1 измененных файлов с 3 добавлено и 0 удалено
  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());