diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index d185d7d1..5f303e33 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -1433,10 +1433,12 @@ opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno return OPJ_FALSE; } else { - tcd->image->comps[compno].resno_decoded = - tile->comps[compno].numresolutions - tcd->cp->reduce - 1; + tcd->image->comps[compno].resno_decoded = tile->comps[compno].numresolutions - tcd->cp->reduce - 1; } } + else { + tcd->image->comps[compno].resno_decoded = tile->comps[compno].numresolutions - 1; + } numres2decode = tcd->image->comps[compno].resno_decoded + 1; if(numres2decode > 0){