From 9a76cc9cebb1a067dabe4aae74aaef6d6c8993a2 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..72971a8 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;