From 69547495f8d478eadb0e96ad5cbc7e98c042ab83 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Mon, 2 Mar 2020 15:53:16 +0200
Subject: [PATCH] Fix no depth bug in border mask

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

diff --git a/components/operators/src/mask.cpp b/components/operators/src/mask.cpp
index 31038b7bb..0fe2030c7 100644
--- a/components/operators/src/mask.cpp
+++ b/components/operators/src/mask.cpp
@@ -64,6 +64,10 @@ bool BorderMask::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, cudaStream_t
 	int topm = config()->value("top",5);
 	int bottomm = config()->value("bottom",5);
 
+	if (!in.hasChannel(Channel::Depth)) {
+		return true;
+	}
+
 	ftl::cuda::border_mask(
 		out.createTexture<uint8_t>(Channel::Mask, ftl::rgbd::Format<uint8_t>(in.get<cv::cuda::GpuMat>(Channel::Depth).size())),
 		leftm, rightm, topm, bottomm, stream
-- 
GitLab