Commit 77483005 authored by Michael Niedermayer's avatar Michael Niedermayer

cook: check subbands more completely, fix out of array read.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 84281d11
......@@ -1197,6 +1197,10 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
av_log_ask_for_sample(avctx, "subbands > 50\n");
return AVERROR_PATCHWELCOME;
}
if (q->subpacket[s].subbands == 0) {
av_log_ask_for_sample(avctx, "subbands is 0\n");
return AVERROR_PATCHWELCOME;
}
q->subpacket[s].gains1.now = q->subpacket[s].gain_1;
q->subpacket[s].gains1.previous = q->subpacket[s].gain_2;
q->subpacket[s].gains2.now = q->subpacket[s].gain_3;
......
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