fixed a bug in mqc.c (see https://groups.google.com/d/topic/openjpeg/kQ1PbZUd19k/discussion, credit to Peter Wimmer)
This commit is contained in:
parent
175fd6692c
commit
2a5a6416a5
1
CHANGES
1
CHANGES
|
@ -6,6 +6,7 @@ What's New for OpenJPEG
|
||||||
+ : added
|
+ : added
|
||||||
|
|
||||||
April 16, 2011
|
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
|
* [antonin] fixed wrong path in Doxyfile.dox
|
||||||
|
|
||||||
April 14, 2011
|
April 14, 2011
|
||||||
|
|
|
@ -521,22 +521,21 @@ void mqc_init_dec(opj_mqc_t *mqc, unsigned char *bp, int len) {
|
||||||
unsigned int c;
|
unsigned int c;
|
||||||
unsigned int *ip;
|
unsigned int *ip;
|
||||||
unsigned char *end = mqc->end - 1;
|
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;
|
ip = (unsigned int *) mqc->buffer;
|
||||||
|
|
||||||
while (bp != end) {
|
while (bp < end) {
|
||||||
c = *(bp + 1);
|
c = *(bp + 1);
|
||||||
if (*bp == 0xff) {
|
if (*bp == 0xff) {
|
||||||
if (c > 0x8f) {
|
if (c > 0x8f) {
|
||||||
*ip = 0x0000ff18;
|
break;
|
||||||
} else {
|
} else {
|
||||||
bp++;
|
|
||||||
*ip = 0x00000017 | (c << 9);
|
*ip = 0x00000017 | (c << 9);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bp++;
|
|
||||||
*ip = 0x00000018 | (c << 8);
|
*ip = 0x00000018 | (c << 8);
|
||||||
}
|
}
|
||||||
|
bp++;
|
||||||
ip++;
|
ip++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue