From d4bed3df83c7d1b14b967c86bc9ff1da0a0226f5 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter Date: Wed, 20 Dec 2023 11:17:56 +0100 Subject: [PATCH] iadk: module_adapter: Check return code for sink/source Add check of return code for sink/source api functions. Signed-off-by: Jaroslaw Stelter --- src/audio/module_adapter/iadk/iadk_module_adapter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/audio/module_adapter/iadk/iadk_module_adapter.cpp b/src/audio/module_adapter/iadk/iadk_module_adapter.cpp index c2820ef4d782..92ad7bdc8661 100644 --- a/src/audio/module_adapter/iadk/iadk_module_adapter.cpp +++ b/src/audio/module_adapter/iadk/iadk_module_adapter.cpp @@ -57,6 +57,9 @@ uint32_t IadkModuleAdapter::IadkModuleAdapter_Process(struct sof_source **source i_size = source_get_data_available(sources[i]); ret = source_get_data(sources[i], i_size, (const void **)&input, (const void **)&input_start, &input_end); + if (ret != 0) + return ret; + const intel_adsp::InputStreamBuffer isb_data( (uint8_t *)input, i_size, flags); new (&input_stream_buffers[i]) intel_adsp::InputStreamBuffer(isb_data); @@ -69,6 +72,9 @@ uint32_t IadkModuleAdapter::IadkModuleAdapter_Process(struct sof_source **source o_size = sink_get_free_size(sinks[i]); ret = sink_get_buffer(sinks[i], o_size, (void **)&output, (void **)&output_start, &output_end); + if (ret != 0) + return ret; + const intel_adsp::OutputStreamBuffer osb_data( (uint8_t *)output, o_size); new (&output_stream_buffers[i]) intel_adsp::OutputStreamBuffer(osb_data);