SDL_mixer: Import an stb_vorbis fix from upstream PR/1490: (4b326)

From 4b32651dd957ed2436115640289bb373ac2e80b8 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 18 Jun 2023 23:56:04 +0300
Subject: [PATCH] Import an stb_vorbis fix from upstream PR/1490:

Patch by Alice Rowan (@AliceLR): https://github.com/nothings/stb/pull/1490

Fix broken clamp in codebook_decode_deinterleave_repeat.

The clamp on the effective number of dimensions to decode in
`codebook_decode_deinterleave_repeat` is trivially broken.
libFuzzer managed to find some inputs that exploit this to increase
the number of dimensions to be read past the end of the multiplicands
array.
---
 src/codecs/stb_vorbis/stb_vorbis.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/codecs/stb_vorbis/stb_vorbis.h b/src/codecs/stb_vorbis/stb_vorbis.h
index 9addd23d..554620df 100644
--- a/src/codecs/stb_vorbis/stb_vorbis.h
+++ b/src/codecs/stb_vorbis/stb_vorbis.h
@@ -1974,7 +1974,7 @@ static int codebook_decode_deinterleave_repeat(vorb *f, Codebook *c, float **out
       // buffer (len*ch), our current offset within it (p_inter*ch)+(c_inter),
       // and the length we'll be using (effective)
       if (c_inter + p_inter*ch + effective > len * ch) {
-         effective = len*ch - (p_inter*ch - c_inter);
+         effective = len*ch - (p_inter*ch + c_inter);
       }
 
    #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK