From 4670274ec303082e0fb86ff3be1ea4170a17662f Mon Sep 17 00:00:00 2001 From: Leo Uino Date: Fri, 15 Jul 2011 14:20:41 +0900 Subject: qr_mask_apply() works in-place --- lpg/libqr/code-parse.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lpg/libqr/code-parse.c') diff --git a/lpg/libqr/code-parse.c b/lpg/libqr/code-parse.c index 29d96bb..7a98280 100644 --- a/lpg/libqr/code-parse.c +++ b/lpg/libqr/code-parse.c @@ -212,11 +212,9 @@ int qr_code_parse(const void * buffer, fprintf(stderr, "detected ec type %d; mask %d\n", ec, mask); - code.modules = qr_mask_apply(&src_bmp, mask); - if (code.modules == NULL) { - fprintf(stderr, "failed to apply mask\n"); - return -1; - } + code.modules = qr_bitmap_clone(&src_bmp); + /* XXX: check return */ + qr_mask_apply(code.modules, mask); qr_layout_init_mask(&code); -- cgit v1.2.3-70-g09d2