diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-17 16:56:35 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-18 17:50:30 +0100 |
commit | 5bb9ce755b5913f53eb72c2f18942671d6f3a850 (patch) | |
tree | 8e9dda25edf8c0dd241f89b37b65b98c58dac225 | |
parent | ea5a5f09088c94d32492173c2fc39b8eb36e56d1 (diff) | |
download | ffmpeg-5bb9ce755b5913f53eb72c2f18942671d6f3a850.tar.gz |
cook: Fix js_vlc_bits value validation for joint stereo
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 3a742470a845c24e7c3a40c0a228705ca951e673)
Signed-off-by: Anton Khirnov <anton@khirnov.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 05d8d7a3cf..a8fa01e5d2 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1175,8 +1175,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; } |