[libromdata] GdiReaderPrivate::parseGdiFile(): Adjust the track check so we don't go over 127.

Similar to a change made in the previous CDI commit.
This commit is contained in:
David Korth 2024-10-18 01:08:52 -04:00
parent f86758b502
commit 21e2bc3f0d

View File

@ -219,8 +219,8 @@ int GdiReaderPrivate::parseGdiFile(char *gdibuf)
// Save the track information.
const size_t idx = blockRanges.size();
assert(idx <= std::numeric_limits<int8_t>::max());
if (idx > std::numeric_limits<int8_t>::max()) {
assert(idx < std::numeric_limits<int8_t>::max());
if (idx >= std::numeric_limits<int8_t>::max()) {
// Too many tracks. (More than 127???)
return -ENOMEM;
}