Commit 3a742470 authored by Laurent Aimar's avatar Laurent Aimar Committed by Janne Grunau

cook: Fix js_vlc_bits value validation for joint stereo

Signed-off-by: 's avatarJanne Grunau <janne-libav@jannau.net>
parent 1775b92f
...@@ -1174,8 +1174,9 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) ...@@ -1174,8 +1174,9 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
return -1; return -1;
} }
if ((q->subpacket[s].js_vlc_bits > 6) || (q->subpacket[s].js_vlc_bits < 0)) { 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 >= 0 and <= 6 allowed!\n",q->subpacket[s].js_vlc_bits); 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; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment