Commit a6a45774 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dcadec: Check nchans

Fixes CID1239110
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent cc5e4bb4
......@@ -229,6 +229,14 @@ static int dca_parse_audio_coding_header(DCAContext *s, int base_channel,
}
nchans = get_bits(&s->gb, 3) + 1;
if (xxch && nchans >= 3) {
av_log(s->avctx, AV_LOG_ERROR, "nchans %d is too large\n", nchans);
return AVERROR_INVALIDDATA;
} else if (nchans + base_channel > DCA_PRIM_CHANNELS_MAX) {
av_log(s->avctx, AV_LOG_ERROR, "channel sum %d + %d is too large\n", nchans, base_channel);
return AVERROR_INVALIDDATA;
}
s->total_channels = nchans + base_channel;
s->prim_channels = s->total_channels;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment