Menu

#108 QR code possible bug: format info grid initialization

1.0
closed
None
2019-03-15
2018-06-22
No

I'm not sure that this is a bug, but it looks very suspicious... the grid initialization code uses hex values across the board, except this one line that initializes one value to "20" (no leading 0x):

https://sourceforge.net/p/zint/code/ci/master/tree/backend/qr.c#l647

/* Reserve space for format information */
for (i = 0; i < 8; i++) {
    grid[(8 * size) + i] += 0x20;
    grid[(i * size) + 8] += 0x20;
    grid[(8 * size) + (size - 1 - i)] = 0x20;
    grid[((size - 1 - i) * size) + 8] = 0x20;
}
grid[(8 * size) + 8] += 20;
grid[((size - 1 - 7) * size) + 8] = 0x21; /* Dark Module from Figure 25 */

Discussion

  • Robin Stuart

    Robin Stuart - 2019-03-15

    Hi Daniel,

    That should definately by 0x20.

    Thank you,

    Robin.

     
  • Robin Stuart

    Robin Stuart - 2019-03-15
    • status: open --> closed
    • assigned_to: Robin Stuart
     
  • Robin Stuart

    Robin Stuart - 2019-03-15

    Code updated.

     

Log in to post a comment.

MongoDB Logo MongoDB