mirror of https://github.com/AxioDL/nod.git
DiscBase: Prevent potential off-by-one case within getPartitonNodeCount()
We should be comparing with >= instead of >.
This commit is contained in:
parent
4bba7af2c2
commit
7ddff919c1
|
@ -351,8 +351,9 @@ public:
|
|||
const Header& getHeader() const { return m_header; }
|
||||
const IDiscIO& getDiscIO() const { return *m_discIO; }
|
||||
size_t getPartitonNodeCount(size_t partition = 0) const {
|
||||
if (partition > m_partitions.size())
|
||||
if (partition >= m_partitions.size()) {
|
||||
return -1;
|
||||
}
|
||||
return m_partitions[partition]->getNodeCount();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue