From 75912912b496d276d58a0ce5ce8bc798c69aef30 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 12 Jan 2012 16:55:14 +0000 Subject: Fix bug from a few minutes ago git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1625 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- analyzer/pgmtexture.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'analyzer/pgmtexture.c') diff --git a/analyzer/pgmtexture.c b/analyzer/pgmtexture.c index 1a0e2980..03723c73 100644 --- a/analyzer/pgmtexture.c +++ b/analyzer/pgmtexture.c @@ -707,13 +707,15 @@ f10_dvar (float ** const p, /*---------------------------------------------------------------------------- Difference Variance -----------------------------------------------------------------------------*/ - double pxpy[PGM_MAXMAXVAL]; + double pxpy[PGM_MAXMAXVAL + 1]; unsigned int i; double sqrNg; /* Square of 'ng' */ double sum; double sumSqr; double var; + assert(ng <= ARRAY_SIZE(pxpy)); + for (i = 0; i < ng; ++i) pxpy[i] = 0; -- cgit 1.4.1