avcodec/jpeg2000dec: Assert that step_x/y are valid
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 22:28:36 +0000 (00:28 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 22:37:53 +0000 (00:37 +0200)
Fixes CID1322304, CID1322305

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/jpeg2000dec.c

index 66c5375..8a803e7 100644 (file)
@@ -1111,6 +1111,7 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
                 step_x = FFMIN(step_x, rlevel->log2_prec_width  + reducedresno);
                 step_y = FFMIN(step_y, rlevel->log2_prec_height + reducedresno);
             }
+            av_assert0(step_x < 32 && step_y < 32);
             step_x = 1<<step_x;
             step_y = 1<<step_y;