diff options
-rw-r--r-- | src/armnnTfLiteParser/TfLiteParser.cpp | 4 | ||||
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetwork.cpp | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp index 8e0fae68d1..a18471a71e 100644 --- a/src/armnnTfLiteParser/TfLiteParser.cpp +++ b/src/armnnTfLiteParser/TfLiteParser.cpp @@ -2130,6 +2130,10 @@ void TfLiteParser::ParseReshape(size_t subgraphIndex, size_t operatorIndex) // Extract target shape from input auto bufferPtr = GetBuffer(m_Model, inputs[1]->buffer); auto values = reinterpret_cast<const int32_t*>(bufferPtr->data.data()); + if (!values) + { + ARMNN_THROW_PARSE_EXCEPTION("Reshape operator target shape input buffer data is null"); + } for (int i=0; i < inputs[1]->shape[0]; ++i) { targetShape.push_back(values[i]); diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index 6880a17c52..5df5dfbce7 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -61,6 +61,11 @@ int TfLiteDelegateMainImpl(const ExecuteNetworkParams& params, armnnDelegate::TfLiteArmnnDelegateDelete); // Register armnn_delegate to TfLiteInterpreter int status = tfLiteInterpreter->ModifyGraphWithDelegate(std::move(theArmnnDelegate)); + if (status == kTfLiteError) + { + ARMNN_LOG(fatal) << "Could not register ArmNN TfLite Delegate to TfLiteInterpreter!"; + return EXIT_FAILURE; + } std::vector<std::string> inputBindings; for (const std::string& inputName: params.m_InputNames) |