[PATCH 1/3] conhost: Copy font width/height to the new screen buffer to prevent an unhandled exception (divide by zero)

Hugh McMaster hugh.mcmaster at outlook.com
Fri Jul 9 07:40:38 CDT 2021


CreateConsoleScreenBuffer() copies properties relating to the current
console font to the new screen buffer when called.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50187

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/conhost/conhost.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 7db1261d3be..adcfe00d7e9 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -92,10 +92,12 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int
 
     if (console->active)
     {
-        screen_buffer->max_width  = console->active->max_width;
-        screen_buffer->max_height = console->active->max_height;
-        screen_buffer->win.right  = console->active->win.right  - console->active->win.left;
-        screen_buffer->win.bottom = console->active->win.bottom - console->active->win.top;
+        screen_buffer->max_width   = console->active->max_width;
+        screen_buffer->max_height  = console->active->max_height;
+        screen_buffer->win.right   = console->active->win.right  - console->active->win.left;
+        screen_buffer->win.bottom  = console->active->win.bottom - console->active->win.top;
+        screen_buffer->font.width  = console->active->font.width;
+        screen_buffer->font.height = console->active->font.height;
     }
     else
     {
-- 
2.32.0




More information about the wine-devel mailing list