From 9096b1c76864955bc5dbb8918f66def822cad606 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Mon, 8 Jun 2020 21:57:27 +0300 Subject: [PATCH] dnn/NGraph: added nullptr checks --- modules/dnn/src/dnn.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index 1eb1055966..c7ed6a4c17 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -2023,6 +2023,7 @@ struct Net::Impl : public detail::NetImplBase Ptr inpNode = inpLd.backendNodes[preferableBackend]; if (!inpNode.empty()) { Ptr ieNode = inpNode.dynamicCast(); + CV_Assert(!ieNode.empty()); ieNode->net->setUnconnectedNodes(ieNode); } } @@ -2067,6 +2068,7 @@ struct Net::Impl : public detail::NetImplBase int cons_inp = cons->oid; Ptr inpWrapper = inpLd.outputBlobsWrappers[cons_inp]. dynamicCast(); + CV_Assert(!inpWrapper.empty()); auto iter = std::find(inputNames.begin(), inputNames.end(), inpWrapper->dataPtr->getName()); if (iter == inputNames.end()) {