avcodec/jpeg2000dec: Continue decoding reslevels even when empty ones are encountered
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 18 Jun 2015 00:22:45 +0000 (02:22 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 18 Jun 2015 00:23:37 +0000 (02:23 +0200)
Fixes Ticket4635

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jpeg2000dec.c

index 3553542..4d82340 100644 (file)
@@ -1119,13 +1119,13 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
 
                         precno = prcx + rlevel->num_precincts_x * prcy;
 
+                        ok_reslevel = 1;
                         if (prcx >= rlevel->num_precincts_x || prcy >= rlevel->num_precincts_y) {
                             av_log(s->avctx, AV_LOG_WARNING, "prc %d %d outside limits %d %d\n",
                                    prcx, prcy, rlevel->num_precincts_x, rlevel->num_precincts_y);
                             continue;
                         }
 
-                            ok_reslevel = 1;
                             for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
                                 if ((ret = jpeg2000_decode_packet(s, tile, &tp_index,
                                                                 codsty, rlevel,