From 10541d1fade07e57441b591a36b0bf02f5eca299 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Tue, 3 Aug 2021 13:05:23 +0200 Subject: [PATCH] gallium/hud: initialize query Most of the drivers don't set up the maximum value in the query info. So when later hud_pane_set_max_value() is invoked, we are using a rather "random" number. Turns out that in some 32bit cases, this random number is big enough that `leftmost_digit` is 0 because DIV_ROUND_UP() overflows, aborting with an assertion. Fixes: c91cf7d7d2c ("gallium: implement a heads-up display module") Reviewed-By: Mike Blumenkrantz Signed-off-by: Juan A. Suarez Romero Part-of: --- src/gallium/auxiliary/hud/hud_driver_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/hud/hud_driver_query.c b/src/gallium/auxiliary/hud/hud_driver_query.c index 382de1af028..f15c7104460 100644 --- a/src/gallium/auxiliary/hud/hud_driver_query.c +++ b/src/gallium/auxiliary/hud/hud_driver_query.c @@ -424,7 +424,7 @@ hud_driver_query_install(struct hud_batch_query_context **pbq, struct hud_pane *pane, struct pipe_screen *screen, const char *name) { - struct pipe_driver_query_info query; + struct pipe_driver_query_info query = { 0 }; unsigned num_queries, i; boolean found = FALSE;