From ef04090a4795382215c5e0667498e31cd6769d0d Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 24 Sep 2022 22:56:43 -0500 Subject: [PATCH] fix BRR loading corruption --- src/engine/brrUtils.c | 4 ++-- src/engine/sample.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/brrUtils.c b/src/engine/brrUtils.c index a32e5160..2e850307 100644 --- a/src/engine/brrUtils.c +++ b/src/engine/brrUtils.c @@ -111,10 +111,10 @@ long brrEncode(short* buf, unsigned char* out, long len, long loopStart) { next+=(last1*15)/16; \ break; \ case 8: \ - next+=((last1*61)/32)-((last2*15)/16); \ + next+=((last2*61)/32)-((last1*15)/16); \ break; \ case 12: \ - next+=((last1*115)/64)-((last2*13)/16); \ + next+=((last2*115)/64)-((last1*13)/16); \ break; \ } \ \ diff --git a/src/engine/sample.cpp b/src/engine/sample.cpp index 5e994c70..ecebcfe7 100644 --- a/src/engine/sample.cpp +++ b/src/engine/sample.cpp @@ -852,7 +852,7 @@ void DivSample::render() { } break; case DIV_SAMPLE_DEPTH_BRR: // BRR - brrDecode(dataBRR,data16,samples); + brrDecode(dataBRR,data16,lengthBRR); break; case DIV_SAMPLE_DEPTH_VOX: // VOX oki_decode(dataVOX,data16,samples);