From 1630d845fb1055a630faab26916371166daf7cb9 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sat, 12 Mar 2011 23:41:28 +0100 Subject: [PATCH] Fix off-by-one out of bounds/memory corruption bug in sobel --- libol/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.52.0