From 906ed530b8c28bf384666b0c0187fc53f3cc0ead Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Tue, 15 Oct 2024 13:14:24 -0700 Subject: [PATCH] Fix incorrect PCM data offset --- backends/playback/zsm/zsm_backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/playback/zsm/zsm_backend.cpp b/backends/playback/zsm/zsm_backend.cpp index a1ab804..641dfd0 100644 --- a/backends/playback/zsm/zsm_backend.cpp +++ b/backends/playback/zsm/zsm_backend.cpp @@ -46,7 +46,7 @@ void ZsmBackend::load(const char *filename) { file->seek(pcm_offset, SeekType::SET); file->read(loop_point, 1, 1); pcm_offset++; - pcm_data_offs = (loop_point[0] * 16) + pcm_offset; + pcm_data_offs = (((uint16_t)loop_point[0]) + 1) * 16) + pcm_offset; file->seek(music_data_start, SeekType::SET); this->loop_point = std::max(this->loop_point, (uint32_t)music_data_start); double prev_time = 0.0;