Skip to content
Snippets Groups Projects
Commit 5d465814 authored by Thomas Guillem's avatar Thomas Guillem Committed by Steve Lhomme
Browse files

coreaudio: fix stack overflow in MapOutputLayout()


When outlayout->mNumberChannelDescriptions is bigger than AOUT_CHAN_MAX.

Fixes #28424

(cherry picked from commit 5225251c)
Signed-off-by: default avatarThomas Guillem <thomas@gllm.fr>
parent 94eafa60
Branches 3.0.x
No related tags found
No related merge requests found
......@@ -736,6 +736,7 @@ MapOutputLayout(audio_output_t *p_aout, audio_sample_format_t *fmt,
"for 7.1 Rear Surround");
}
size_t chans_out_idx = 0;
for (unsigned i = 0; i < outlayout->mNumberChannelDescriptions; i++)
{
AudioChannelLabel chan =
......@@ -747,15 +748,12 @@ MapOutputLayout(audio_output_t *p_aout, audio_sample_format_t *fmt,
AudioChannelLabelToVlcChan(chan, swap_rear_surround == 2);
if (mapped_chan != 0)
{
chans_out[i] = mapped_chan;
chans_out[chans_out_idx++] = mapped_chan;
fmt->i_physical_channels |= mapped_chan;
}
else
{
chans_out[i] = 0;
msg_Dbg(p_aout, "found nonrecognized channel %d at index "
"%d", chan, i);
}
}
if (fmt->i_physical_channels == 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment