SDL_mixer: music_drflac: fix crash when playing a looped track (0cd90)

From 0cd90476b8294e736e11cc11a5d66d5848ee3c0d Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 1 May 2023 11:55:10 +0300
Subject: [PATCH] music_drflac: fix crash when playing a looped track

Patch from Michael Day
Fixes https://github.com/libsdl-org/SDL_mixer/issues/511
---
 src/codecs/music_drflac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/codecs/music_drflac.c b/src/codecs/music_drflac.c
index 253da697..5cd934b3 100644
--- a/src/codecs/music_drflac.c
+++ b/src/codecs/music_drflac.c
@@ -281,7 +281,7 @@ static int DRFLAC_GetSome(void *context, void *data, int bytes, SDL_bool *done)
     if (amount > 0) {
         if (music->loop && (music->play_count != 1) &&
             ((Sint64)music->dec->currentPCMFrame >= music->loop_end)) {
-            amount -= (music->dec->currentPCMFrame - music->loop_end) * sizeof(drflac_int16) * music->channels;
+            amount -= (music->dec->currentPCMFrame - music->loop_end);
             music->loop_flag = SDL_TRUE;
         }
         if (SDL_AudioStreamPut(music->stream, music->buffer, (int)amount * sizeof(drflac_int16) * music->channels) < 0) {