mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
topology: Fix the missing referenced elem ptr when merging private data
tplg_copy_data() should set the valid referenced data element pointer on success. The caller will double check this pointer for all kinds of references, including controls and data. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
776eb7fa5e
commit
98a0a2a98f
1 changed files with 5 additions and 1 deletions
|
|
@ -1049,8 +1049,10 @@ int tplg_copy_data(snd_tplg_t *tplg, struct tplg_elem *elem,
|
|||
|
||||
tplg_dbg("Data '%s' used by '%s'\n", ref->id, elem->id);
|
||||
/* overlook empty private data */
|
||||
if (!ref_elem->data || !ref_elem->data->size)
|
||||
if (!ref_elem->data || !ref_elem->data->size) {
|
||||
ref->elem = ref_elem;
|
||||
return 0;
|
||||
}
|
||||
|
||||
old_priv = get_priv_data(elem);
|
||||
if (!old_priv)
|
||||
|
|
@ -1074,6 +1076,8 @@ int tplg_copy_data(snd_tplg_t *tplg, struct tplg_elem *elem,
|
|||
ref_elem->compound_elem = 1;
|
||||
memcpy(priv->data + old_priv_data_size,
|
||||
ref_elem->data->data, priv_data_size);
|
||||
|
||||
ref->elem = ref_elem;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue