Skip to content

Commit

Permalink
[libromdata] GdiReaderPrivate::parseGdiFile(): Adjust the track check…
Browse files Browse the repository at this point in the history
… so we don't go over 127.

Similar to a change made in the previous CDI commit.
  • Loading branch information
GerbilSoft committed Oct 18, 2024
1 parent f86758b commit 21e2bc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libromdata/disc/GdiReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 21e2bc3

Please sign in to comment.