From 7418ec5009a0203b562bcf128713ef741815fe0e Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 1 Mar 2021 14:00:16 -0500 Subject: FS#13267: Fix crash when enabling Perceptual Bass Enhancment during playback I think the assumption is that during playback, the DSP is already running so it assumes PBE needs to be flushed before it is properly enabled. Change-Id: I2bac3d02c80f97c8d9ce26a575175f6344a8e86a --- lib/rbcodec/dsp/pbe.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/rbcodec') diff --git a/lib/rbcodec/dsp/pbe.c b/lib/rbcodec/dsp/pbe.c index 8fb893a661..634849d91c 100644 --- a/lib/rbcodec/dsp/pbe.c +++ b/lib/rbcodec/dsp/pbe.c @@ -64,6 +64,9 @@ static void pbe_buffer_free(void) static void dsp_pbe_flush(void) { + if (handle < 0) + return; + memset(core_get_data(handle), 0, PBE_BUFSIZE); b0_r[0] = 0; b0_w[0] = 0; @@ -142,6 +145,9 @@ static void pbe_process(struct dsp_proc_entry *this, int32_t *b0[2], *b2[2], *b3[2]; + if (handle < 0) + return; + b0[0] = core_get_data(handle); b0[1] = b0[0] + B0_SIZE; b2[0] = b0[1] + B0_SIZE; -- cgit v1.2.3