Skip to content

Commit 9c4c2cc

Browse files
softwareckikv2019i
authored andcommitted
module_adapter: ModuleInitialSettingsConcrete: Fix possible null reference
The dataAs function can return null if the buffer size is smaller than the size of the target structure. Added handler for this situation. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> (cherry picked from commit c9e0fc8)
1 parent 2d834e9 commit 9c4c2cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/audio/module_adapter/iadk/module_initial_settings_concrete.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ ModuleInitialSettingsConcrete::ModuleInitialSettingsConcrete(DwordArray const &c
4949
/* It shall contain BaseModuleCfg + BaseModuleCfgExt + */
5050
/* optionally some InputPinFormat[] + OutputPinFormat[] data */
5151
CompoundCfg const * unvalidated_compound_cfg = cfg_ipc_msg.dataAs<CompoundCfg>();
52+
if (!unvalidated_compound_cfg)
53+
return;
54+
5255
const size_t computed_msg_size =
5356
sizeof(CompoundCfg) -
5457
/* CompoundCfg already contains one InputPinFormat and

0 commit comments

Comments
 (0)