do not try to access data pointed to by mqc bp until it reaches the start of the mqc buffer
This commit is contained in:
parent
1b86fb6f48
commit
5b7c4445e8
|
@ -203,7 +203,7 @@ static opj_mqc_state_t mqc_states[47 * 2] = {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void opj_mqc_byteout(opj_mqc_t *mqc) {
|
static void opj_mqc_byteout(opj_mqc_t *mqc) {
|
||||||
if (*mqc->bp == 0xff) {
|
if ( (mqc->bp >= mqc->start) & (*mqc->bp == 0xff)) {
|
||||||
mqc->bp++;
|
mqc->bp++;
|
||||||
*mqc->bp = (OPJ_BYTE)(mqc->c >> 20);
|
*mqc->bp = (OPJ_BYTE)(mqc->c >> 20);
|
||||||
mqc->c &= 0xfffff;
|
mqc->c &= 0xfffff;
|
||||||
|
|
Loading…
Reference in New Issue