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 <matteo.martincigh@arm.com>
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 @@
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;
}