From a6539ed27cd676838827e82100487ee33a8e4fe2 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Tue, 27 Aug 2019 13:43:32 +0100 Subject: [PATCH] IVGCVSW-3277 Fix RequiresCopy in case a tensor handle factory is not available * Added null checks prior of using either the source or the destination handle factory when checking if the tensor requires to be copied Change-Id: Icc6737562849be5e7d1a62243327366e06312eb9 Signed-off-by: Matteo Martincigh --- src/armnn/Network.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index 932f9eb..0ef1407 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -441,7 +441,8 @@ bool RequiresCopy(ITensorHandleFactory::FactoryId src, ITensorHandleFactory* srcFactory = registry.GetFactory(src); ITensorHandleFactory* dstFactory = registry.GetFactory(dst); - if ((srcFactory->GetExportFlags() & dstFactory->GetImportFlags()) != 0) + if (srcFactory && dstFactory && + (srcFactory->GetExportFlags() & dstFactory->GetImportFlags()) != 0) { return false; } -- 2.7.4