check vector emptiness before access it

Signed-off-by: Li Peng <peng.li@intel.com>
pull/10795/head
Li Peng 7 years ago
parent 389fa5d38e
commit c43498c6ad
  1. 7
      modules/dnn/src/dnn.cpp

@ -1266,8 +1266,11 @@ struct Net::Impl
if ( preferableTarget == DNN_TARGET_OPENCL )
{
nextData = &layers[activData->consumers[0].lid];
lpNext = LayerPin(activData->consumers[0].lid, 0);
if ( !activData->consumers.empty() )
{
nextData = &layers[activData->consumers[0].lid];
lpNext = LayerPin(activData->consumers[0].lid, 0);
}
}
}
}

Loading…
Cancel
Save