From 505dfd12fee24c6ddf6578f9e8d61aae8d4394c1 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 12 Jan 2010 03:54:10 +0000 Subject: Fix wild pointer in ppmd_fill_drawproc() git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1097 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libppmd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/libppmd.c b/lib/libppmd.c index 1234d89f..235df40d 100644 --- a/lib/libppmd.c +++ b/lib/libppmd.c @@ -1053,7 +1053,6 @@ ppmd_fill_drawprocp(pixel ** const pixels, const void * const clientdata) { fillobj * fh; - coord * ocp; fh = (fillobj*) clientdata; @@ -1070,8 +1069,6 @@ ppmd_fill_drawprocp(pixel ** const pixels, REALLOCARRAY(fh->coords, fh->size); if (fh->coords == NULL) pm_error("out of memory enlarging a fillhandle"); - - ocp = &(fh->coords[fh->n - 1]); } /* Check for extremum and set the edge number. */ @@ -1081,6 +1078,7 @@ ppmd_fill_drawprocp(pixel ** const pixels, fh->ydir = 0; fh->startydir = 0; } else { + coord * const ocp = &(fh->coords[fh->n - 1]); int const dx = p.x - ocp->point.x; int const dy = p.y - ocp->point.y; -- cgit 1.4.1