Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions gzdoom/0001-Fix-libxmp-playback.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From f6facdaa683e7159b7569d5287a088da352a7c92 Mon Sep 17 00:00:00 2001
From: Andrew Rabert <[email protected]>
Date: Sat, 11 Jan 2025 00:26:08 -0500
Subject: [PATCH] Fix libxmp playback Fixes crashing when the int16_buffer is
smaller than the desired len. Particularly, I was seeing the int16_buffer
with a size of 0.

---
source/streamsources/music_libxmp.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/streamsources/music_libxmp.cpp b/source/streamsources/music_libxmp.cpp
index e235b06..999e046 100644
--- a/source/streamsources/music_libxmp.cpp
+++ b/source/streamsources/music_libxmp.cpp
@@ -126,7 +126,7 @@ bool XMPSong::SetSubsong(int subsong)

bool XMPSong::GetData(void *buffer, size_t len)
{
- if ((len / 4) < int16_buffer.size())
+ if ((len / 4) > int16_buffer.size())
int16_buffer.resize(len / 4);

int ret = xmp_play_buffer(context, (void*)int16_buffer.data(), len / 2, m_Looping? INT_MAX : 0);
--
2.47.1

4 changes: 4 additions & 0 deletions gzdoom/zmusic.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"stable-only": true,
"url-template": "https://github.com/zdoom/ZMusic/archive/$version.tar.gz"
}
},
{
"type": "patch",
"path": "0001-Fix-libxmp-playback.patch"
}
]
}
Loading