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. 3
      modules/dnn/src/dnn.cpp

@ -1265,12 +1265,15 @@ struct Net::Impl
ld.outputBlobsWrappers = layers[lpNext.lid].outputBlobsWrappers;
if ( preferableTarget == DNN_TARGET_OPENCL )
{
if ( !activData->consumers.empty() )
{
nextData = &layers[activData->consumers[0].lid];
lpNext = LayerPin(activData->consumers[0].lid, 0);
}
}
}
}
// fuse convlution layer followed by eltwise + relu
if ( preferableTarget == DNN_TARGET_OPENCL )

Loading…
Cancel
Save