Commit c77d409b authored by Martin Storsjö's avatar Martin Storsjö

twinvqdec: Check the ibps parameter separately

This is required, since invalid parameters actually could
pass the switch check below.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 8583b142
......@@ -356,6 +356,10 @@ static av_cold int twinvq_decode_init(AVCodecContext *avctx)
: AV_CH_LAYOUT_STEREO;
ibps = avctx->bit_rate / (1000 * avctx->channels);
if (ibps < 8 || ibps > 48) {
av_log(avctx, AV_LOG_ERROR, "Bad bitrate per channel value %d\n", ibps);
return AVERROR_INVALIDDATA;
}
switch ((isampf << 8) + ibps) {
case (8 << 8) + 8:
......
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