From 57e6e7e88914afd1bd0483433f973568919c1417 Mon Sep 17 00:00:00 2001 From: aliguori Date: Wed, 21 Jan 2009 18:58:51 +0000 Subject: [PATCH] Adds null check for DisplayStatus (Stefano Stabellini) Allocate a DisplaySurface in dumb_display_init if none else does it. The DisplaySurface will be used for the qemu monitor, serial and parallel ports, etc. Signed-off-by: Andrew May Signed-off-by: Stefano Stabellini Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6387 c046a42c-6fe2-441c-8c8c-71466251a162 --- vl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vl.c b/vl.c index 63d954b..b246e47 100644 --- a/vl.c +++ b/vl.c @@ -2778,6 +2778,11 @@ DisplayState *get_displaystate(void) static void dumb_display_init(void) { DisplayState *ds = qemu_mallocz(sizeof(DisplayState)); + if (ds == NULL) { + fprintf(stderr, "dumb_display_init: DisplayState allocation failed\n"); + exit(1); + } + ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4); register_displaystate(ds); } -- 2.7.4