Skip to content

Commit 3a25ed1

Browse files
author
Roman Donchenko
committed
demos/common: fix issues with uninitialized variables
1 parent 5e3aaf2 commit 3a25ed1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

demos/common/models/include/models/model_base.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020

2121
class ModelBase {
2222
public:
23-
ModelBase(const std::string& modelFileName) { this->modelFileName = modelFileName; }
23+
ModelBase(const std::string& modelFileName)
24+
: execNetwork(nullptr), modelFileName(modelFileName)
25+
{}
26+
2427
virtual ~ModelBase() {}
2528

2629
virtual void prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNetwork) = 0;

demos/common/pipelines/src/config_factory.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ CnnConfig ConfigFactory::getCommonConfig(const std::string& flags_d, const std::
106106
config.clKernelsConfigPath = flags_c;
107107
}
108108

109-
if (flags_nireq) {
110-
config.maxAsyncRequests = flags_nireq;
109+
if (flags_nireq == 0) {
110+
throw std::runtime_error("The value of -nireq must be greater than 0");
111111
}
112+
config.maxAsyncRequests = flags_nireq;
112113

113114
/** Per layer metrics **/
114115
if (flags_pc) {

0 commit comments

Comments
 (0)