aboutsummaryrefslogtreecommitdiff
path: root/lpg/libqr/code-create.c
diff options
context:
space:
mode:
authorLeo Uino <leo@norisys.jp>2011-07-15 14:20:41 +0900
committerLeo Uino <leo@norisys.jp>2011-07-15 14:20:41 +0900
commit4670274ec303082e0fb86ff3be1ea4170a17662f (patch)
treee51c1a8fe6cbc5ac04516337b9fce0a2f6aebd09 /lpg/libqr/code-create.c
parent9f4843d686bca0d75bee174d8249fbf72527b94a (diff)
downloadpdf-simple-sign-4670274ec303082e0fb86ff3be1ea4170a17662f.tar.gz
pdf-simple-sign-4670274ec303082e0fb86ff3be1ea4170a17662f.tar.xz
pdf-simple-sign-4670274ec303082e0fb86ff3be1ea4170a17662f.zip
qr_mask_apply() works in-place
Diffstat (limited to 'lpg/libqr/code-create.c')
-rw-r--r--lpg/libqr/code-create.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lpg/libqr/code-create.c b/lpg/libqr/code-create.c
index 680b405..f29778f 100644
--- a/lpg/libqr/code-create.c
+++ b/lpg/libqr/code-create.c
@@ -332,11 +332,12 @@ static int mask_data(struct qr_code * code)
/* Generate bitmap for each mask and evaluate */
for (i = 0; i < 8; ++i) {
- test = qr_mask_apply(code->modules, i);
+ test = qr_bitmap_clone(code->modules);
if (!test) {
qr_bitmap_destroy(mask);
return -1;
}
+ qr_mask_apply(test, i);
score = score_mask(test);
fprintf(stderr, "mask %d scored %d\n", i, score);
if (!mask || score < best) {