diff --git a/RecoJets/JetProducers/plugins/VirtualJetProducer.cc b/RecoJets/JetProducers/plugins/VirtualJetProducer.cc index 2aa9bf468cfa6..424939af0415b 100644 --- a/RecoJets/JetProducers/plugins/VirtualJetProducer.cc +++ b/RecoJets/JetProducers/plugins/VirtualJetProducer.cc @@ -685,7 +685,7 @@ void VirtualJetProducer::writeJets(edm::Event& iEvent, edm::EventSetup const& iS if (!fjJets_.empty()) { // Distance between jet centers and overlap area -- for disk-based area calculation using RIJ = std::pair; - std::vector rijStorage(fjJets_.size() * (fjJets_.size() / 2)); + std::vector rijStorage(fjJets_.size() == 1 ? 1 : fjJets_.size() * (fjJets_.size() >> 1)); std::vector rij(fjJets_.size()); unsigned int k = 0; for (unsigned int ijet = 0; ijet < fjJets_.size(); ++ijet) {