diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-17 16:56:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-17 17:44:56 +0200 |
commit | 352c878de6fca57a3f2a6369e27ca442fa5f9518 (patch) | |
tree | 47d44dd5ed052705b611247e61d9702545c77131 /libavcodec/cook.c | |
parent | 9a0a64cb26bc6aaa7f29106bded8a27f3db918ee (diff) | |
download | ffmpeg-352c878de6fca57a3f2a6369e27ca442fa5f9518.tar.gz |
Fix js_vlc_bits value validation when joint stereo is used in cook decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cook.c')
-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 6def1ac2f7..0d09bb83fb 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; } |