From patchwork Sun Feb 8 21:44:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1808 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587077; bh=KSLQPbOVQaM11c93kss39FfDpKCiI31Tel8coxGZjus=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Y/KagrACtRIqtf5IlOrcbgh44AvVClqTBu7thR3IHB5XW4+X9Og1VIValOTNH+KBg RGsQYPuDdxOfGxT8iaiEdIYKseriKWwx0zYtl544/KrYxDj6JZsHFCQGj64q4I5dWP tv2rTCW2D1nEqLW4m41MX6ccvpI97vxsDiodITCDoJirrNM2KExEgAk3/p8deO8/pr e7E0clCMPH0UbL+Y3gY0+uNjN3saDexiyjOoYnf0dH0Om23WfqlCAAwAbWRzHb8651 WahVn+zetlp2okZnbq8qwDN4ZHDbPHrE60Jx/7+p53GdgA5S5HyM+fxHM9LDi4rQHI lCgnw+a86rcKg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C14D9699EA for ; Sun, 8 Feb 2026 14:44:37 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HXZlckzyS7-X for ; Sun, 8 Feb 2026 14:44:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587077; bh=KSLQPbOVQaM11c93kss39FfDpKCiI31Tel8coxGZjus=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Y/KagrACtRIqtf5IlOrcbgh44AvVClqTBu7thR3IHB5XW4+X9Og1VIValOTNH+KBg RGsQYPuDdxOfGxT8iaiEdIYKseriKWwx0zYtl544/KrYxDj6JZsHFCQGj64q4I5dWP tv2rTCW2D1nEqLW4m41MX6ccvpI97vxsDiodITCDoJirrNM2KExEgAk3/p8deO8/pr e7E0clCMPH0UbL+Y3gY0+uNjN3saDexiyjOoYnf0dH0Om23WfqlCAAwAbWRzHb8651 WahVn+zetlp2okZnbq8qwDN4ZHDbPHrE60Jx/7+p53GdgA5S5HyM+fxHM9LDi4rQHI lCgnw+a86rcKg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0B0B699E6 for ; Sun, 8 Feb 2026 14:44:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587074; bh=Dfg16F7G7Br+MQgsqxlxiStkMMvny5SpPQgmHGu7Mlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+nb+P7BxrK7g5R7YA8KNe/Hacb6mShGiG+pIUrQ38Er2oz45stV87W6kolkYPQz7 DKM50tjzHk/jij6eS+biycWJuWsHgBJe/RtobdOgil7wMB6YPIEqWoqAUCc0EnFASj 3prhRsXU0+Br5ddwG7N0ysv+J4JM8kZGk81jGOboEKsHC/JnMD4DSLHJ0JrOg/i4RX t+sDCx3QwJ1+ChuRGgmAqXbce34BRzOQyiOX6qzZ4PbRwS85VqyPeX9IYlzUIyaBqi twbjeYxqpTNIjhJn7d+2gzxZ9UvkS1lkoqqpT/yKysfHGC+XApYI5QsZ5xp6c12H6f dbd66FDI3BfOw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A6682699DC; Sun, 8 Feb 2026 14:44:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 2MV2E_CUdbSD; Sun, 8 Feb 2026 14:44:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587070; bh=BzsqMVdHYGhGaTqgNfqkAPya+sI6gulJNw9I0xCsiEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Upk5qPT/D7y9+g6C+mRujGNs4o7Dmw0v9+qcpq0VNeq7JQWZJPwGkXeGRP29Zo/eT dtme/vgY2kWJLPMx9Yz0oNKFtbQumn3a3wJK6vFHf7w0qfmHIJBmG/52zg8PJzdpJs I8+Wd3VuFmHD+HehYm2g1eBfSPJR+yAermH776PkbDhwJ5ZWNFh0T3OFsO41rkocvE au89dkL+6mKDNp8xODg5OLdbLQy7reZ7+3wr/lbDC75DBWUoqOv4cIEOPAC9mjx1d2 bDHn1a6GXgUTD0VmMjn6+EiZnzf2zROfhaU77vJ8axd0VOYFi6h805M+BAk6YU+T0u /IcXY9fKTbZkA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 55CD669970; Sun, 8 Feb 2026 14:44:30 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 8 Feb 2026 14:44:02 -0700 Message-ID: <20260208214411.3445278-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260208214411.3445278-1-sjg@u-boot.org> References: <20260208214411.3445278-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: X3WJBN7GAISYTKU326ZA63652ZB4FFEZ X-Message-ID-Hash: X3WJBN7GAISYTKU326ZA63652ZB4FFEZ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 1/4] video: truetype: Fix uninitialised bbox on empty text List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When truetype_measure() is called with empty text, it returns early without initialising the bbox fields. This causes scene_obj_get_hw() to return garbage values (uninitialised stack memory) for the height, leading to intermittent test failures. Initialise all bbox fields to 0 before the early return when text is empty. Fixes: adf54041976c ("console: Allow measuring the bounding box of text") Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_truetype.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 913ed4208e4..8ca0308942b 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -1021,8 +1021,13 @@ static int truetype_measure(struct udevice *dev, const char *name, uint size, return log_msg_ret("sel", ret); bbox->valid = false; - if (!*text) + if (!*text) { + bbox->x0 = 0; + bbox->y0 = 0; + bbox->x1 = 0; + bbox->y1 = 0; return 0; + } limit = -1; if (pixel_limit != -1)