mirror of https://github.com/thesofproject/sof.git
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>
This commit is contained in:
parent
6f2475b086
commit
c9e0fc8c9a
|
@ -49,6 +49,9 @@ ModuleInitialSettingsConcrete::ModuleInitialSettingsConcrete(DwordArray const &c
|
|||
/* It shall contain BaseModuleCfg + BaseModuleCfgExt + */
|
||||
/* optionally some InputPinFormat[] + OutputPinFormat[] data */
|
||||
CompoundCfg const * unvalidated_compound_cfg = cfg_ipc_msg.dataAs<CompoundCfg>();
|
||||
if (!unvalidated_compound_cfg)
|
||||
return;
|
||||
|
||||
const size_t computed_msg_size =
|
||||
sizeof(CompoundCfg) -
|
||||
/* CompoundCfg already contains one InputPinFormat and
|
||||
|
|
Loading…
Reference in New Issue