Skip to contentSkip to conversation

[6387] Adds null check for DisplayStatus (Stefano Stabellini)

Qemu-devel Anthony Liguori 1 participant 1 message Jan 21, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6387

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6387
Author:   aliguori
Date:     2009-01-21 18:58:51 +0000 (Wed, 21 Jan 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
trunk/vl.c

Modified: trunk/vl.c
===================================================================

vl.c +5 -0
@@ -2778,6 +2778,11 @@
 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);
 }