fixed glibc error with broken2 and broken4 images

This commit is contained in:
Mickael Savinaud 2011-08-10 08:47:20 +00:00
parent e634cd0d62
commit 9e419fdaf7
2 changed files with 15 additions and 3 deletions

View File

@ -8,6 +8,7 @@ What's New for OpenJPEG
August 10, 2011 August 10, 2011
! [mickael] removed unused parameters warnings with the solution proposed by myself and Bob Friesenhahn. ! [mickael] removed unused parameters warnings with the solution proposed by myself and Bob Friesenhahn.
! [mickael] add copyright header into new test functions. ! [mickael] add copyright header into new test functions.
* [mickael] fixed glibc error with broken2 and broken4 images.
August 9, 2011 August 9, 2011
- [antonin] removed xcode project files (cmake and autotools are now the only supported build methods) - [antonin] removed xcode project files (cmake and autotools are now the only supported build methods)

View File

@ -838,6 +838,15 @@ static void j2k_read_qcx(opj_j2k_t *j2k, int compno, int len) {
}; };
}; };
#else
/* We check whether there are too many subbands */
if ((numbands < 0) || (numbands >= J2K_MAXBANDS)) {
opj_event_msg(j2k->cinfo, EVT_WARNING ,
"bad number of subbands in Sqcx (%d) regarding to J2K_MAXBANDS (%d) \n"
"- limiting number of bands to J2K_MAXBANDS and try to move to the next markers\n", numbands, J2K_MAXBANDS);
}
#endif /* USE_JPWL */ #endif /* USE_JPWL */
for (bandno = 0; bandno < numbands; bandno++) { for (bandno = 0; bandno < numbands; bandno++) {
@ -850,8 +859,10 @@ static void j2k_read_qcx(opj_j2k_t *j2k, int compno, int len) {
expn = tmp >> 11; expn = tmp >> 11;
mant = tmp & 0x7ff; mant = tmp & 0x7ff;
} }
tccp->stepsizes[bandno].expn = expn; if (bandno < J2K_MAXBANDS){
tccp->stepsizes[bandno].mant = mant; tccp->stepsizes[bandno].expn = expn;
tccp->stepsizes[bandno].mant = mant;
}
} }
/* Add Antonin : if scalar_derived -> compute other stepsizes */ /* Add Antonin : if scalar_derived -> compute other stepsizes */