mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-11 03:32:39 +00:00
dca: Validate the channel map
Having a mismatch between the number of channels in the stream and those in the channel map will lead to a segfault or worse. Bug-Id: 1016 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
3df77b58e3
commit
e245d4f45c
@ -1297,6 +1297,9 @@ static int set_channel_layout(AVCodecContext *avctx, int channels, int num_core_
|
|||||||
s->channel_order_tab = ff_dca_channel_reorder_nolfe[s->amode];
|
s->channel_order_tab = ff_dca_channel_reorder_nolfe[s->amode];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channels < ff_dca_channels[s->amode])
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
if (channels > !!s->lfe &&
|
if (channels > !!s->lfe &&
|
||||||
s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
|
s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
Loading…
Reference in New Issue
Block a user