mirror of https://git.ffmpeg.org/ffmpeg.git
jpeg2000dec: Check bpno in decode_cblk()
Fixes integer overflow in fate-redcode-demux Reviewed-by: Nicolas BERTRAND <nicoinattendu@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d5caf10c4f
commit
8e887ca1fe
|
@ -901,6 +901,10 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
|
||||||
ff_mqc_initdec(&t1->mqc, cblk->data);
|
ff_mqc_initdec(&t1->mqc, cblk->data);
|
||||||
|
|
||||||
while (passno--) {
|
while (passno--) {
|
||||||
|
if (bpno < 0) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "bpno invalid\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
switch(pass_t) {
|
switch(pass_t) {
|
||||||
case 0:
|
case 0:
|
||||||
decode_sigpass(t1, width, height, bpno + 1, bandpos,
|
decode_sigpass(t1, width, height, bpno + 1, bandpos,
|
||||||
|
|
Loading…
Reference in New Issue