diff options
Diffstat (limited to 'ports/quirc/patch-for-msvc.patch')
| -rw-r--r-- | ports/quirc/patch-for-msvc.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ports/quirc/patch-for-msvc.patch b/ports/quirc/patch-for-msvc.patch new file mode 100644 index 000000000..c755d04a7 --- /dev/null +++ b/ports/quirc/patch-for-msvc.patch @@ -0,0 +1,36 @@ +From 1c1ceecb70ad76751f0b573937380525d7643a87 Mon Sep 17 00:00:00 2001 +From: reyzal <reyzal@163.com> +Date: Sun, 4 Mar 2018 12:09:34 +0800 +Subject: [PATCH] for msvc + +--- + lib/identify.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/identify.c b/lib/identify.c +index bf7bd94..cd16b0a 100644 +--- a/lib/identify.c ++++ b/lib/identify.c +@@ -196,9 +196,9 @@ static void threshold(struct quirc *q) + threshold_s = THRESHOLD_S_MIN; + + for (y = 0; y < q->h; y++) { +- int row_average[q->w]; ++ int *row_average = malloc(q->w * sizeof(int)); + +- memset(row_average, 0, sizeof(row_average)); ++ memset(row_average, 0, q->w * sizeof(int)); + + for (x = 0; x < q->w; x++) { + int w, u; +@@ -229,6 +229,7 @@ static void threshold(struct quirc *q) + } + + row += q->w; ++ free(row_average); + } + } + +-- +2.7.3.windows.1 + |
