Commit b8dc5f8b authored by Michael Niedermayer's avatar Michael Niedermayer

twinvq: check bitrate for validity avoid division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e481ba2e
......@@ -1142,6 +1142,11 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
ibps = avctx->bit_rate / (1000 * avctx->channels);
if (ibps > 255) {
av_log(avctx, AV_LOG_ERROR, "unsupported per channel bitrate %dkbps\n", ibps);
return AVERROR_INVALIDDATA;
}
switch ((isampf << 8) + ibps) {
case (8 <<8) + 8: tctx->mtab = &mode_08_08; break;
case (11<<8) + 8: tctx->mtab = &mode_11_08; break;
......
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