avcodec/jpeg2000dec: Check that step_x/y are valid before use in JPEG2000_PGOD_PCRL

Fixes: CID1322305 and CID1322304

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-10-11 14:52:39 +02:00
parent 49f4967dd0
commit c08b06c225
1 changed files with 4 additions and 0 deletions

View File

@ -1244,6 +1244,10 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
step_y = FFMIN(step_y, rlevel->log2_prec_height + reducedresno);
}
}
if (step_x >= 31 || step_y >= 31){
avpriv_request_sample(s->avctx, "PCRL with large step");
return AVERROR_PATCHWELCOME;
}
step_x = 1<<step_x;
step_y = 1<<step_y;