Skip to content

Commit

Permalink
[Ref] MP3 Samples: libmpg123: Fix integer overflow when using 64bit i…
Browse files Browse the repository at this point in the history
…nternal file offsets.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22083 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Nov 2, 2024
1 parent db55c3a commit 5b7907b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion soundlib/SampleFormatMP3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ComponentMPG123
static int FileReaderRead(void *fp, void *buf, size_t count, size_t *returned)
{
FileReader &file = *static_cast<FileReader *>(fp);
std::size_t readBytes = std::min(count, static_cast<size_t>(file.BytesLeft()));
std::size_t readBytes = std::min(count, mpt::saturate_cast<size_t>(file.BytesLeft()));
file.ReadRaw(mpt::span(mpt::void_cast<std::byte*>(buf), readBytes));
if(!returned)
{
Expand Down

0 comments on commit 5b7907b

Please sign in to comment.