From e7797b97a1922e0d38d705916117c29af96471a0 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Sat, 9 Apr 2016 19:02:05 +0200 Subject: [PATCH] Fix uninitialized variable reported by cppcheck Also reorder initialization to follow declaration order --- src/lib/openjp2/t1_generate_luts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/openjp2/t1_generate_luts.c b/src/lib/openjp2/t1_generate_luts.c index 1997d3997..cba7245d2 100644 --- a/src/lib/openjp2/t1_generate_luts.c +++ b/src/lib/openjp2/t1_generate_luts.c @@ -40,10 +40,12 @@ static int t1_init_ctxno_zc(int f, int orient) { int h, v, d, n, t, hv; - n = 0; h = ((f & T1_SIG_W) != 0) + ((f & T1_SIG_E) != 0); v = ((f & T1_SIG_N) != 0) + ((f & T1_SIG_S) != 0); d = ((f & T1_SIG_NW) != 0) + ((f & T1_SIG_NE) != 0) + ((f & T1_SIG_SE) != 0) + ((f & T1_SIG_SW) != 0); + n = 0; + t = 0; + hv = 0; switch (orient) { case 2: