aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-17 16:56:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-21 19:50:08 +0200
commit4d8330d09565956ac40036e7b4af58d2d775d03e (patch)
tree2d595dd87f442e349df543076944a8dea1edd6a3 /libavcodec
parent30d7dce94fc74a8ef8369ffe97f0b8b5484ff502 (diff)
downloadffmpeg-4d8330d09565956ac40036e7b4af58d2d775d03e.tar.gz
Fix js_vlc_bits value validation when joint stereo is used in cook decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 352c878de6fca57a3f2a6369e27ca442fa5f9518)
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cook.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 116be2fe98..192ec5bdf1 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;
}