Commit c43498c6 authored by Li Peng's avatar Li Peng

check vector emptiness before access it

Signed-off-by: 's avatarLi Peng <peng.li@intel.com>
parent 389fa5d3
...@@ -1266,8 +1266,11 @@ struct Net::Impl ...@@ -1266,8 +1266,11 @@ struct Net::Impl
if ( preferableTarget == DNN_TARGET_OPENCL ) if ( preferableTarget == DNN_TARGET_OPENCL )
{ {
nextData = &layers[activData->consumers[0].lid]; if ( !activData->consumers.empty() )
lpNext = LayerPin(activData->consumers[0].lid, 0); {
nextData = &layers[activData->consumers[0].lid];
lpNext = LayerPin(activData->consumers[0].lid, 0);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment