qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Adds null check for DisplayStatus


From: Stefano Stabellini
Subject: [Qemu-devel] [PATCH] Adds null check for DisplayStatus
Date: Tue, 20 Jan 2009 10:53:50 +0000
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

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  <address@hidden>
Signed-off-by: Stefano Stabellini <address@hidden>

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);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]