From: bellard Date: Thu, 15 Apr 2004 22:35:16 +0000 (+0000) Subject: avoid segfault if transient invalid text resolution X-Git-Tag: release_0_9_0-iwjtag~1668 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3294b949eb97f41e29432830370eba62a6d5f28d;p=qemu-xen-unstable.git avoid segfault if transient invalid text resolution git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@727 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/hw/vga.c b/hw/vga.c index 1321f7b24a..3a634a4d53 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -1154,6 +1154,11 @@ static void vga_draw_text(VGAState *s, int full_update) ((s->cr[0x07] & 0x40) << 3); height = (height + 1) / cheight; } + if ((height * width) > CH_ATTR_SIZE) { + /* better than nothing: exit if transient size is too big */ + return; + } + if (width != s->last_width || height != s->last_height || cw != s->last_cw || cheight != s->last_ch) { s->last_scr_width = width * cw;