summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzc62 <chenzh1993@gmail.com>2019-02-21 23:10:09 -0500
committerJan Ekström <jeebjp@gmail.com>2019-02-23 00:21:54 +0200
commita1279123455b11dcf2ae1c5729891b2909c67dea (patch)
tree17017ea341aeb441776642e2e0ec97764552584b
parent8b563a034604ff5ab2ad92d12c63e806f45d1bb6 (diff)
downloadmpv-a1279123455b11dcf2ae1c5729891b2909c67dea.tar.bz2
mpv-a1279123455b11dcf2ae1c5729891b2909c67dea.tar.xz
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
-rw-r--r--filters/f_swresample.c2
1 files changed, 1 insertions, 1 deletions
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);