audio: fix segfault caused by incorrect number of planes

Use `mp_aframe_get_planes` to properly get the number of planes, instead
of assuming it to be the number of channels.

Fixes #6092
This commit is contained in:
zc62 2019-02-21 23:10:09 -05:00 committed by Jan Ekström
parent 8b563a0346
commit a127912345
1 changed files with 1 additions and 1 deletions

View File

@ -399,7 +399,7 @@ static bool reorder_planes(struct mp_aframe *mpa, int *reorder,
if (!mp_aframe_set_chmap(mpa, newmap))
return false;
int num_planes = newmap->num;
int num_planes = mp_aframe_get_planes(mpa);
uint8_t **planes = mp_aframe_get_data_rw(mpa);
uint8_t *old_planes[MP_NUM_CHANNELS];
assert(num_planes <= MP_NUM_CHANNELS);