From 7238077705e9d120babe207f31822043333106cc Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 18 Aug 2023 18:17:44 +0300 Subject: [PATCH] Audio: SRC: Avoid divide by zero when source frame bytes is not set Workaround, not yet root cause fix for start of streaming. The divide by zero would happen in source_get_data_frames_available() right after this addition. Signed-off-by: Seppo Ingalsuo --- src/audio/src/src.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 94c0e0aef18a..32ef2c316246 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -685,6 +685,10 @@ static int src_get_copy_limits(struct comp_data *cd, s1 = cd->src.stage1; s2 = cd->src.stage2; + /* Workaround for a pipeline issue in beginning of processing */ + if (!source_get_frame_bytes(source)) + return -EIO; + /* Calculate how many blocks can be processed with * available source and free sink frames amount. */