From 14e38b17d6bce630edf8baafc54402219b61f7ca Mon Sep 17 00:00:00 2001
From: Brick <[EMAIL REDACTED]>
Date: Sun, 20 Aug 2023 20:43:31 +0100
Subject: [PATCH] Removed assertions from inner ResampleAudio loop
---
src/audio/SDL_audiocvt.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 90090fb9623a..13e129dcdcf2 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -100,7 +100,6 @@ static void ResampleAudio(const int chans, const float *lpadding, const float *r
for (j = 0; j < RESAMPLER_ZERO_CROSSINGS; j++) {
const int filt_ind = j + filterindex1;
const int srcframe = srcindex - j;
- SDL_assert(paddinglen + srcframe >= 0);
/* !!! FIXME: we can bubble this conditional out of here by doing a pre loop. */
const float insample = (srcframe < 0) ? lpadding[((paddinglen + srcframe) * chans) + chan] : inbuf[(srcframe * chans) + chan];
outsample += (float) (insample * (ResamplerFilter[filt_ind] + (interpolation1 * ResamplerFilterDifference[filt_ind])));
@@ -110,7 +109,6 @@ static void ResampleAudio(const int chans, const float *lpadding, const float *r
for (j = 0; j < RESAMPLER_ZERO_CROSSINGS; j++) {
const int filt_ind = j + filterindex2;
const int srcframe = srcindex + 1 + j;
- SDL_assert(srcframe - inframes < paddinglen);
// !!! FIXME: we can bubble this conditional out of here by doing a post loop.
const float insample = (srcframe >= inframes) ? rpadding[((srcframe - inframes) * chans) + chan] : inbuf[(srcframe * chans) + chan];
outsample += (float) (insample * (ResamplerFilter[filt_ind] + (interpolation2 * ResamplerFilterDifference[filt_ind])));