From 9d20de8d29ab6694f69b74ee6ce3a745711a5876 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Fri, 29 May 2020 11:12:52 +0800 Subject: [PATCH] fix UWP build error - fix the following UWP build errors caught by vcpkg's CI src\wavelib.c(3673): error C4703: potentially uninitialized local pointer variable 'out' used src\wavelib.c(3499): error C4703: potentially uninitialized local pointer variable 'wavecoeff' used - move the definition of `out` variable to support old C89 compilers; --- src/wavelib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wavelib.c b/src/wavelib.c index a7d4ae8..d40f491 100644 --- a/src/wavelib.c +++ b/src/wavelib.c @@ -3353,7 +3353,7 @@ void setWTConv(wt_object wt, const char *cmethod) { } double* dwt2(wt2_object wt, double *inp) { - double *wavecoeff; + double *wavecoeff = NULL; int i, J, iter, N, lp, rows_n, cols_n, rows_i, cols_i; int ir, ic, istride,ostride; int aLL, aLH, aHL, aHH, cdim,clen; @@ -3504,11 +3504,11 @@ void idwt2(wt2_object wt, double *wavecoeff, double *oup) { int istride, ostride, iter, J; int aLL, aLH, aHL, aHH; double *cL, *cH, *X_lp,*orig; + double *out = NULL; rows = wt->rows; cols = wt->cols; J = wt->J; - double *out; if (!strcmp(wt->ext, "per")) {