diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-17 19:33:48 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-09-17 23:22:46 +0300 |
commit | c77d409bf95954aceb762dd800d1ee2868c4b0d4 (patch) | |
tree | 000a494b9c167f8989651abdcaaacfe48986bf8a | |
parent | 8583b14252deac71136f1dec231910abab0ba503 (diff) | |
download | ffmpeg-c77d409bf95954aceb762dd800d1ee2868c4b0d4.tar.gz |
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: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavcodec/twinvqdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/twinvqdec.c b/libavcodec/twinvqdec.c index a88b6ffe83..580c1f2040 100644 --- a/libavcodec/twinvqdec.c +++ b/libavcodec/twinvqdec.c @@ -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: |