Fix POC in multi-tile scenarios: avoid almost endless loop when a tile has no POC settings

This commit is contained in:
Even Rouault 2019-04-25 01:27:02 +02:00
parent b86717fdd3
commit 6423163141
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D
1 changed files with 4 additions and 3 deletions

View File

@ -1669,7 +1669,6 @@ static OPJ_BOOL opj_j2k_check_poc_val(const opj_poc_t *p_pocs,
index += step_r;
}
++p_pocs;
}
@ -7179,7 +7178,6 @@ OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k,
if (parameters->numpocs) {
/* initialisation of POC */
tcp->POC = 1;
for (i = 0; i < parameters->numpocs; i++) {
if (tileno + 1 == parameters->POC[i].tile) {
opj_poc_t *tcp_poc = &tcp->pocs[numpocs_tile];
@ -7196,7 +7194,10 @@ OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k,
}
}
tcp->numpocs = numpocs_tile - 1 ;
if (numpocs_tile) {
tcp->POC = 1;
tcp->numpocs = numpocs_tile - 1 ;
}
} else {
tcp->numpocs = 0;
}