DiscBase: Prevent potential off-by-one case within getPartitonNodeCount()

We should be comparing with >= instead of >.
This commit is contained in:
Lioncash 2019-09-05 21:55:56 -04:00
parent 4bba7af2c2
commit 7ddff919c1
1 changed files with 2 additions and 1 deletions

View File

@ -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();
}