From a1279123455b11dcf2ae1c5729891b2909c67dea Mon Sep 17 00:00:00 2001 From: zc62 Date: Thu, 21 Feb 2019 23:10:09 -0500 Subject: 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 --- filters/f_swresample.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filters/f_swresample.c b/filters/f_swresample.c index 49f69cbbd7..8ee44195a8 100644 --- a/filters/f_swresample.c +++ b/filters/f_swresample.c @@ -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); -- cgit v1.2.3