diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-17 16:56:35 +0200 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2011-10-06 23:31:06 +0200 |
commit | 3a742470a845c24e7c3a40c0a228705ca951e673 (patch) | |
tree | 3a6fea29b43d22d880fd0b6ccf3af5aee6d79720 | |
parent | 1775b92fee43f0527e2f5892a5a30450fa929722 (diff) | |
download | ffmpeg-3a742470a845c24e7c3a40c0a228705ca951e673.tar.gz |
cook: Fix js_vlc_bits value validation for joint stereo
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
-rw-r--r-- | libavcodec/cook.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c index b5492db27b..13f2dd66a6 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1174,8 +1174,9 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) return -1; } - if ((q->subpacket[s].js_vlc_bits > 6) || (q->subpacket[s].js_vlc_bits < 0)) { - av_log(avctx,AV_LOG_ERROR,"js_vlc_bits = %d, only >= 0 and <= 6 allowed!\n",q->subpacket[s].js_vlc_bits); + if ((q->subpacket[s].js_vlc_bits > 6) || (q->subpacket[s].js_vlc_bits < 2*q->subpacket[s].joint_stereo)) { + av_log(avctx,AV_LOG_ERROR,"js_vlc_bits = %d, only >= %d and <= 6 allowed!\n", + q->subpacket[s].js_vlc_bits, 2*q->subpacket[s].joint_stereo); return -1; } |