This commit is contained in:
Antonin Descampe 2011-04-16 12:09:16 +00:00
parent 175fd6692c
commit 2a5a6416a5
2 changed files with 5 additions and 5 deletions

View File

@ -6,6 +6,7 @@ What's New for OpenJPEG
+ : added
April 16, 2011
* [antonin] fixed a bug in mqc.c (see https://groups.google.com/d/topic/openjpeg/kQ1PbZUd19k/discussion, credit to Peter Wimmer)
* [antonin] fixed wrong path in Doxyfile.dox
April 14, 2011

View File

@ -521,22 +521,21 @@ void mqc_init_dec(opj_mqc_t *mqc, unsigned char *bp, int len) {
unsigned int c;
unsigned int *ip;
unsigned char *end = mqc->end - 1;
mqc->buffer = opj_realloc(mqc->buffer, (2 * len + 1) * sizeof(unsigned int));
mqc->buffer = opj_realloc(mqc->buffer, (len + 1) * sizeof(unsigned int));
ip = (unsigned int *) mqc->buffer;
while (bp != end) {
while (bp < end) {
c = *(bp + 1);
if (*bp == 0xff) {
if (c > 0x8f) {
*ip = 0x0000ff18;
break;
} else {
bp++;
*ip = 0x00000017 | (c << 9);
}
} else {
bp++;
*ip = 0x00000018 | (c << 8);
}
bp++;
ip++;
}