From 2fb8327c76a4e8f33c1f854fff06d7d04dd56c70 Mon Sep 17 00:00:00 2001 From: jakllsch Date: Fri, 1 Mar 2019 23:14:13 +0000 Subject: Reset 'height' before underlining in rasops32_putchar_aa(). Prevents segfault when underlining whitespace in the upper left cell. --- sys/dev/rasops/rasops32.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/rasops/rasops32.c b/sys/dev/rasops/rasops32.c index 07b0d68589d..ff22418edfe 100644 --- a/sys/dev/rasops/rasops32.c +++ b/sys/dev/rasops/rasops32.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops32.c,v 1.29 2013/09/15 09:39:47 martin Exp $ */ +/* $NetBSD: rasops32.c,v 1.30 2019/03/01 23:14:13 jakllsch Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.29 2013/09/15 09:39:47 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.30 2019/03/01 23:14:13 jakllsch Exp $"); #include "opt_rasops.h" @@ -237,6 +237,7 @@ rasops32_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & 1) != 0) { rp = (uint32_t *)rrp; + height = font->fontheight; DELTA(rp, (ri->ri_stride * (height - 2)), int32_t *); while (width--) *rp++ = clr[1]; -- cgit