pcmdec: check that channels is valid.
Prevents a division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user