From 95eaf5838c2e55355efe8e41f1700831840b5d0d Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Fri, 31 Jan 2020 12:52:55 +0200
Subject: [PATCH] Fix exception in remove discon

---
 components/operators/src/mask.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/operators/src/mask.cpp b/components/operators/src/mask.cpp
index 8a8fdaa4b..ac56ba2ad 100644
--- a/components/operators/src/mask.cpp
+++ b/components/operators/src/mask.cpp
@@ -45,6 +45,8 @@ CullDiscontinuity::~CullDiscontinuity() {
 }
 
 bool CullDiscontinuity::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, cudaStream_t stream) {
+	if (!in.hasChannel(Channel::Depth) || !in.hasChannel(Channel::Mask)) return false;
+	
 	out.clearPackets(Channel::Depth);  // Force reset
 	ftl::cuda::cull_discontinuity(
 		in.createTexture<int>(Channel::Mask),
-- 
GitLab