IVGCVSW-3277 Fix RequiresCopy in case a tensor handle factory is not available
authorMatteo Martincigh <matteo.martincigh@arm.com>
Tue, 27 Aug 2019 12:43:32 +0000 (13:43 +0100)
committerMatteo Martincigh <matteo.martincigh@arm.com>
Tue, 27 Aug 2019 12:52:19 +0000 (13:52 +0100)
 * 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>
src/armnn/Network.cpp

index 932f9eb..0ef1407 100644 (file)
@@ -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;
         }