提交 d28d6505 编写于 作者: B Benjamin Herrenschmidt 提交者: Gerd Hoffmann

sdl: Fix crash when calling sdl_switch() with NULL surface

This happens for example when doing ctrl-alt-u and segfaults
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 5f5d82dd
......@@ -135,12 +135,13 @@ static void do_sdl_resize(int width, int height, int bpp)
static void sdl_switch(DisplayChangeListener *dcl,
DisplaySurface *new_surface)
{
PixelFormat pf = qemu_pixelformat_from_pixman(new_surface->format);
PixelFormat pf;
/* temporary hack: allows to call sdl_switch to handle scaling changes */
if (new_surface) {
surface = new_surface;
}
pf = qemu_pixelformat_from_pixman(surface->format);
if (!scaling_active) {
do_sdl_resize(surface_width(surface), surface_height(surface), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册