From: Hector Martin Date: Sat, 12 Mar 2011 22:41:28 +0000 (+0100) Subject: Fix off-by-one out of bounds/memory corruption bug in sobel X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=1630d845fb1055a630faab26916371166daf7cb9;p=openlase.git Fix off-by-one out of bounds/memory corruption bug in sobel --- diff --git a/libol/trace.c b/libol/trace.c index 4d27dd5..aa077ad 100644 --- a/libol/trace.c +++ b/libol/trace.c @@ -547,7 +547,7 @@ static void find_edges_canny(OLTraceCtx *ctx, uint8_t *src, unsigned int stride) px = ctx->sxbuf + y*ctx->aw + 2; py = ctx->sybuf + y*ctx->aw + 2; pm = ctx->smbuf + y*ctx->aw + 2; - for (x = 1; x < (ctx->p.width-2); x++) { + for (x = 2; x < (ctx->p.width-2); x++) { uint32_t gm = *pm; if (gm > low_t) { int16_t gx = *px;