Skip to content

Commit

Permalink
iadk: module_adapter: Check return code for sink/source
Browse files Browse the repository at this point in the history
Add check of return code for sink/source api functions.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
  • Loading branch information
jxstelter authored and kv2019i committed Dec 22, 2023
1 parent b617388 commit d4bed3d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/audio/module_adapter/iadk/iadk_module_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit d4bed3d

Please sign in to comment.