Skip to content

Commit

Permalink
Bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukuchi committed Jan 19, 2010
1 parent b783499 commit 38f4ab1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qrencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ __STATIC unsigned char QRraw_getCode(QRRawCode *raw)
if(raw->count < raw->dataLength) {
row = raw->count % raw->blocks;
col = raw->count / raw->blocks;
if(col >= raw->rsblock[row].dataLength) {
if(col >= raw->rsblock[0].dataLength) {
row += raw->b1;
}
ret = raw->rsblock[row].data[col];
Expand Down Expand Up @@ -519,7 +519,10 @@ __STATIC QRcode *QRcode_encodeMask(QRinput *input, int mask)
}

/* masking */
if(mask < 0) {
if(mask == -2) { // just for debug purpose
masked = (unsigned char *)malloc(width * width);
memcpy(masked, frame, width * width);
} else if(mask < 0) {
masked = Mask_mask(width, frame, input->level);
} else {
masked = Mask_makeMask(width, frame, mask, input->level);
Expand Down

0 comments on commit 38f4ab1

Please sign in to comment.