Skip to content

Commit

Permalink
Merged revision(s) 20333 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] mpt/io_read/filedata_base_unseekable.hpp: Avoid integer overflow in EnsureCacheBuffer() when reading unseekable files are close to uint32_max in size.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@20339 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Mar 15, 2024
1 parent cb5d697 commit 1cf2df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mpt/io_read/filedata_base_unseekable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FileDataUnseekable : public IFileData {
};

void EnsureCacheBuffer(std::size_t requiredbuffersize) const {
if (cache.size() >= cachesize + requiredbuffersize) {
if (cache.size() - cachesize >= requiredbuffersize) {
return;
}
if (cache.size() == 0) {
Expand Down

0 comments on commit 1cf2df4

Please sign in to comment.