From 1f55aaf4a61face93c4e6d5bee95c18ec08c8172 Mon Sep 17 00:00:00 2001 From: Francois-Olivier Devaux Date: Wed, 23 May 2007 16:04:50 +0000 Subject: [PATCH] Bug fixed by Sylvain Munaut. Change in the reading of the POC marker. Since COD/COC can be anywhere in the header, the decoder cannot always know while decoding the POC marker the value of numlayers and numresolution. --- libopenjpeg/j2k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index bf5acf5c..1ef653ee 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -1031,8 +1031,8 @@ static void j2k_read_poc(opj_j2k_t *j2k) { poc = &tcp->pocs[i]; poc->resno0 = cio_read(cio, 1); /* RSpoc_i */ poc->compno0 = cio_read(cio, numcomps <= 256 ? 1 : 2); /* CSpoc_i */ - poc->layno1 = int_min(cio_read(cio, 2), (unsigned int) tcp->numlayers); /* LYEpoc_i */ - poc->resno1 = int_min(cio_read(cio, 1), (unsigned int) tccp->numresolutions); /* REpoc_i */ + poc->layno1 = cio_read(cio, 2); /* LYEpoc_i */ + poc->resno1 = cio_read(cio, 1); /* REpoc_i */ poc->compno1 = int_min( cio_read(cio, numcomps <= 256 ? 1 : 2), (unsigned int) numcomps); /* CEpoc_i */ poc->prg = (OPJ_PROG_ORDER)cio_read(cio, 1); /* Ppoc_i */