Skip to content

Commit

Permalink
[Fix] MOD: Avoid junk in pattern data when reading truncated files.
Browse files Browse the repository at this point in the history
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@21645 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Sep 19, 2024
1 parent 77559e2 commit 72d1689
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion soundlib/MODTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ inline bool IsMagic(const char *magic1, const char (&magic2)[5]) noexcept
template<typename T, typename TFileReader>
inline T ReadAndSwap(TFileReader &file, const bool swapBytes)
{
T value;
T value{};
if(file.Read(value) && swapBytes)
{
static_assert(sizeof(value) % 2u == 0);
Expand Down

0 comments on commit 72d1689

Please sign in to comment.