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>
pull/154/head
Michael Niedermayer 9 years ago
parent 49f4967dd0
commit c08b06c225
  1. 4
      libavcodec/jpeg2000dec.c

@ -1244,6 +1244,10 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
step_y = FFMIN(step_y, rlevel->log2_prec_height + reducedresno); 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_x = 1<<step_x;
step_y = 1<<step_y; step_y = 1<<step_y;

Loading…
Cancel
Save