Commit b8551f8e authored by Michael Niedermayer's avatar Michael Niedermayer

pcmdec: check that channels is valid.

Prevents a division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ac7ff096
......@@ -288,6 +288,11 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR(EINVAL);
}
if (avctx->channels == 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
return AVERROR(EINVAL);
}
n = avctx->channels * sample_size;
if (n && buf_size % n) {
......
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