Skip to contentSkip to conversation

dumb_display_init() crash

PATCH In review Andrew May 2 participants 2 messages Jan 20, 2009

lore
Share & tools
lore

Andrew May

author
#0 lore raw

PATCH 1/1 dumb_display_init() crash

This fixes a crash for the 405 boards that don't do a display init. I would think this is correct but I am not sure if there is more that needs to be setup. This at least gets me back to the SDL display I use to see before the re-org.

trunk/vl.c +6 -0
index 63d954b..cc58df2 100644
@@ -2778,6 +2778,12 @@ DisplayState *get_displaystate(void)
 static void dumb_display_init(void)
 {
     DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
+
+    if (ds == NULL)
+            return;
+
+    ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
+
     register_displaystate(ds);
 }
 
#1 lore raw
Quoted 4 lines · Andrew May

This fixes a crash for the 405 boards that don't do a display init. I would think this is correct but I am not sure if there is more that needs to be setup. This at least gets me back to the SDL display I use to see before the re-org.

Your fix is correct, I am just going to repost your patch adding signed-off-lines and changing the return NULL into exit(1) in case the malloc fails.