summaryrefslogtreecommitdiff
path: root/libavcodec/twinvqdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/twinvqdec.c')
-rw-r--r--libavcodec/twinvqdec.c4
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: