diff options
author | Colm Donelan <colm.donelan@arm.com> | 2023-01-24 22:10:12 +0000 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2023-01-25 11:28:42 +0000 |
commit | 18e6f04232b8aecaec9a232057ac3cb16e4f56f5 (patch) | |
tree | 87144020143756a5ff496eccca6f79075b5e29bb /tests/ExecuteNetwork/ExecuteNetwork.cpp | |
parent | 04d8229bb3e78d1b1dd21eed41e47aabc25d8e2f (diff) | |
download | armnn-18e6f04232b8aecaec9a232057ac3cb16e4f56f5.tar.gz |
IVGCVSW-7441 Fixing null pointers in ExecuteNetwork.
* Check if BuildExecutor returns null in ExecuteNetwork.
* Check if tflite BuildFromFile returns null in TfliteExecutor.
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: I42b6e5f26dfd127dd16b6b322184900846317c41
Diffstat (limited to 'tests/ExecuteNetwork/ExecuteNetwork.cpp')
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetwork.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index c6c8cc0b27..a70f33ff23 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -20,7 +20,7 @@ std::unique_ptr<IExecutor> BuildExecutor(ProgramOptions& programOptions) return std::make_unique<TfLiteExecutor>(programOptions.m_ExNetParams); #else ARMNN_LOG(fatal) << "Not built with Arm NN Tensorflow-Lite delegate support."; - return nullptr; + return nullptr; #endif } else @@ -59,7 +59,7 @@ int main(int argc, const char* argv[]) try { executor = BuildExecutor(programOptions); - if (executor->m_constructionFailed) + if ((!executor) || (executor->m_constructionFailed)) { return EXIT_FAILURE; } |